3 ms·
> to be able to detect the difference between "this expression is a function" and "this expression is the result of the computation of a function" If function
by dragonwriter 5y ago
> to be able to detect the difference between "this expression is a function" and "this expression is the result of the computation of a function"
If function (or method) arguments don't require parenthesis, referring to (rather than calling) a function/method usually requires quite distinct syntax, so it's quite easy to it apart from a call.
It may not be familiar to people coming from languages where no-parens refers to the function and parens call it, but being clear and distinct and being intuitive to people indoctrinated in contrary syntax are not the same thing.
E.g., in ruby (which has methods but not functions in the strict sense) I can call a method with:
thing.square # or thing.square()
Or access the corresponding method object with:
thing.method :square # or, thing.method(:square)
Either of the former options are distinct from both of the latter.