paren-free call expressions

David Griffiths dxgriffiths at gmail.com
Thu May 19 00:45:27 PDT 2011


Hi all,

I'm new to this list but I was writing some notes about paren-free calls this morning and thought they might be relevant.

The trouble with paren-free calls, as implemented in CoffeeScript and others:

- they overload the space character, making it mean something different in only a small fraction of cases.
- they break down whenever calls are nested or part of another expression (requiring a fall-back to explicit parentheses).
- they also make certain other things impossible to write, like named function declarations (blah -> becomes blah(->)).

The first point is major, in my opinion. If the goal is to have an argument list opener that doesn't require an explicit close, then some other character(s) would be a better solution than forcing people to read possible double-meanings into every space they see.

U+0020 is consistently high up in the top 5 most-repeated characters in a JavaScript program, so overloading its meaning for a minor cosmetic effect is not justifiable IMO. And the writability improvement of making list closure optional can be achieved by other means, if it's considered that important.

Regards,

David


More information about the es-discuss mailing list