Re: Terminology: “non-method function”
alex at dojotoolkit.org
Wed Apr 11 03:37:28 PDT 2012
On Apr 11, 2012, at 1:02 AM, Allen Wirfs-Brock wrote:
> On Apr 10, 2012, at 4:01 PM, Axel Rauschmayer wrote:
>> What is a good term for functions that don’t have/use dynamic `this`? “Non-method function” defines them by what they aren’t, I would like a positive definition. I’ve considered the term “pure function”, but the adjective “pure” is already heavily overloaded, especially in functional programming.
>> Any ideas?
> How about:
> procedure - call "callable" object
> method - a procedure that has a dynamic this (or super) dependency
> function - a procedure that does not have a dynamic this dependency
> detached method - a method that has not been associated with an object via Object.defineMethod
What in the world would "defineMethod" do?
The confusing nature of the word "method" seems not to be cleared up by this. How about "bound" and "unbound" functions? Their iterability might bump them into "method" category if bound, but I think that's still just going to confuse non-JS folk.
> FunctionDeclarations and FunctionExpressions may be used to define either methods or functions.
> Arrow Function expression only define functions
> Concise method definitions in object literals and class definitions may define either methods or functions
> It's messy, but emphasizes that the important thing is what the function depends upon rather than which syntactic form was used to define it.
> es-discuss mailing list
> es-discuss at mozilla.org
slightlyoff at google.com
slightlyoff at chromium.org
alex at dojotoolkit.org BE03 E88D EABB 2116 CC49 8259 CF78 E242 59C3 9723
More information about the es-discuss