Re: Terminology: “non-method function”

Allen Wirfs-Brock allen at wirfs-brock.com
Tue Apr 10 17:02:43 PDT 2012


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

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.

Allen


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120410/4832fc23/attachment-0001.html>


More information about the es-discuss mailing list