That hash symbol

Kevin Smith khs4473 at gmail.com
Fri Mar 25 10:15:27 PDT 2011


As a simple matter of taste, I find the # symbol to be quite ugly and have
been thinking of alternatives for shortening function expression syntax.

In working with my own wonky version of promises, I continue to make the
same typing error over and over again.  This is something like what I mean
to type:

obj.doSomething().then(function(val, err)
{
    ...
});

But I find myself typing this instead:

obj.doSomething().then(val, err)
{
    ...
});

The problem isn't so much the extra typing of the "function" keyword, but
the profusion of parens.  I'd like to suggest the following form instead.

obj.doSomething().then(<val, err>
{
    ...
});

Correct me if I'm wrong, but since expressions cannot start with "<", this
shouldn't present any problems for a top-down parser.  Is that right?

Thanks,
khs
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110325/cb09cc67/attachment.html>


More information about the es-discuss mailing list