On Nov 17, 2011, at 11:21 AM, Russell Leggett wrote:
> sorry that last one didn't go to the group - ignore. This new gmail interface
> screwed me up ;)
>
> On Thu, Nov 17, 2011 at 2:20 PM, Russell Leggett <[email protected]>
> wrote:
>
> At this point, if Allen's proposal included a declaration form 'class Point
> {...}' I would be ready to get behind it. I still have a fondness for mine,
> which is used purely for defining classes, but for most cases, his would work
> equally well in the ways I would want to use it.
Here a first (for me for this form) cut:
class AbstractPoint { }
and
class Point AbstractPoiont <| { }
where the syntax of the second is:
classPoint Identifier MemberExpression <| LiteralObject
This means exactly:
let Identifier = class MemberExpression <| LiteralObject
(may need some grammar engineering because MemberExpression can contain a <|)
The expression form remains exactly as I've already defined in it
http://wiki.ecmascript.org/doku.php?id=strawman:class_operator
Strictly speaking the <| is unnecessary and could be implicit. I like
requiring it because it maintains symmetry with the expression form.
For the relatively rare situations where "class-side" methods are needed they
could be provided as part of the ObjectLiteral, as:
class Point AbstractPoiont <| { constructor() {}. {origin() {return new
this(0,0)}}
//class methods are just properties on the constructor function
Allen
>
> - Russ
>
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss