Complete Minimal Classes

Kevin Smith khs4473 at gmail.com
Sun Apr 8 16:14:05 PDT 2012


>
> I can't give you a use case (it's just a felling of being a good design
> thing), but I would like the classes be higher-level construct based on
> low-level ones. If new()/static() gets in, it defines its own exclusive
> semantics not possible to do by plain constructor
>

I agree in general, but as you say, differentiating between [[Call]] and
[[Construct]] is not really possible from within a called function (AFAIK).
 There is a functionality gap here, and I believe that classes are the
right place to fill in that gap.

What does class do if you add new(){} but not static(){}? I presume it
> [[Call]]s new(){} body...


My intuition says that if you did not specify a "static() {}", then
MyClass(...) and new MyClass(...) would be equivalent (ala the more common
pattern in the Chapter 15 "classes").

kevin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20120408/2b302751/attachment.html>


More information about the es-discuss mailing list