with

Axel Rauschmayer axel at rauschma.de
Thu Nov 17 03:17:22 PST 2011


>>    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.

> My first answer was glib, sorry. I'm proposing `with' as a replacement syntax for <|. So the above expression evaluates to the same as
> 
>     obj <| { foo: 12 } <| { bar: 13 } <| { baz: 17 }


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.

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 }


-- 
Dr. Axel Rauschmayer
axel at rauschma.de

home: rauschma.de
twitter: twitter.com/rauschma
blog: 2ality.com



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


More information about the es-discuss mailing list