Swift style syntax
Isiah Meadows
isiahmeadows at gmail.com
Fri Oct 16 19:39:00 UTC 2015
That might work, although these two might need edited for consistency:
- Math.pow === Op.pow (assuming `**` gets in)
- Op.num should be similar to `x => +x`, not `x => ToNumber(x)`. The
behavior is slightly different, but can be observable without modifying
`Number`, I believe.
On Fri, Oct 16, 2015, 14:43 Tab Atkins Jr. <jackalmage at gmail.com> wrote:
> On Thu, Oct 15, 2015 at 11:12 PM, Isiah Meadows <isiahmeadows at gmail.com>
> wrote:
> > I like the idea, but could the function names be made a little
> > shorter? I'd like to at least save some characters on it. Example:
> > `(a, b) => a > b` is 15 characters, where `Math.greaterThan` is 16.
> >
> > For comparison, I also have equivalent versions for the colon-preceded
> operators
> >
> > Here's some naming ideas I have:
> [snip]
>
> At that point, though, the use of the Math namespace starts getting
> weird. Equality and Logical aren't mathematical; Bitwise mostly isn't
> either. (It can sometimes be used to do mathy things, like using
> shift to mul/div by a power of 2, but that's not its core purpose.)
>
> Put them on a new Op namespace object, or into an Op built-in module.
> Even shorter, and clearer!
>
> ~TJ
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20151016/7bb22ae9/attachment.html>
More information about the es-discuss
mailing list