David Herman dherman at mozilla.com
Thu Nov 17 05:47:30 PST 2011

On Nov 17, 2011, at 3:17 AM, Axel Rauschmayer wrote:

>>>    obj with { foo: 12 } with { bar: 13 } with { baz: 17 }
> I like the idea! As it is syntactically different in this role, errors should be easy to spot.
> But I think `with` “points in the wrong direction” (object `obj` *with* prototype `proto`). That is, to me, it suggests a pointer going from prototype to object.

Well, ultimately the directionality is arbitrary. In my proposal it's "prototype `obj` *with* instance `blah`". This results in LTR whereas the other way ends up RTL. JS is built around English, so LTR seems more appropriate (with all due sympathy to our Hebrew-speaking programmers!).

> The above example demonstrates just how well the <| operator works. The main objection to it is that it looks wrong in some fonts? Unless there is a general grawlix objection, something arrow-y would be great.

Every font I ever see it in looks terrible, and there is a general grawlix objection. This is largely an aesthetic thing, but aesthetics matter and people react very strongly against <| or funky Unicode symbols. (The latter just ain't gonna happen.)

> Is there a list of symbols that have already been rejected? Seeing the preposition “with", I feel like suggesting “of” (prototype `proto` *of* object `obj`), but I think that has been rejected before (and is taken by the for loop).
>      obj of { foo: 12 } of { bar: 13 } of { baz: 17 }

We're already using `of` for a different purpose (for-of), and it just reads wrong here.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20111117/82898b0d/attachment.html>

More information about the es-discuss mailing list