An Introduction to JS-Ctypes

Brendan Eich brendan at mozilla.com
Sun Sep 18 06:14:55 PDT 2011


On Sep 18, 2011, at 5:07 AM, Andrea Giammarchi wrote:

> On Sun, Sep 18, 2011 at 7:17 AM, Brendan Eich <brendan at mozilla.com> wrote:
> 
> The point is that you don't *have* to pass a fresh object literal to each constructor call.
> 
> /be
> 
> 
> I know Brendan, my point is that I can predict devs will do every time .... we'll see
> 
> Thanks for other reply, I thought named arguments where proposed tho ... any chance we can discuss this somehow ? ( not here )

Can't use =, that is just the assignment operator, so

  foo(a = 1, b = 2)

is the same as

  (a = 1, b = 2, foo(a, b))

We'd need some new operator or punctuator, e.g.

  foo(a: 1, b: 2)

or

  foo(a => 1, b => 2) // clashes with arrow function syntax

Anyway, this only helps for the "top ply" of the object/array tree containing values to store as binary data. You'd still have object and array literals starting one ply down.

/be



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20110918/8cca9c65/attachment.html>


More information about the es-discuss mailing list