An Introduction to JS-Ctypes

Brendan Eich brendan at mozilla.com
Sat Sep 17 22:14:49 PDT 2011


On Sep 18, 2011, at 12:22 AM, Andrea Giammarchi wrote:

> On Sun, Sep 18, 2011 at 6:07 AM, Brendan Eich <brendan at mozilla.com> wrote:
> 
> Binary data does no such thing! The descriptors are per generated type-constructor, not per instance.
> 
> once you define a StructType how do create an instance ?
> 
> new Point2D({x: 0, y: 0});

p = new Point2D;
p.x = 0;
p.y = 0;


> or binary data can create instances only through ArrayTypes as shown in your slides ?

The slide shows both struct and array type constructor generation and invocation via new. See the harmony proposals for details.


> is there no proposal to bring named arguments as is for python in JS.next ?
> 
> function withDefaults(a = 0, b = 0, c = 0) {
>     return a + b + c;
> }

Yes, that's in the wiki.


> If yes, is there no way to call arguments pythonish way ?
> 
> withDefaults(a = 1, c = 2)

No, that's unrelated and not proposed.

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


More information about the es-discuss mailing list