Luke Hoban wrote:
Herby Vojčík<[email protected]>  wrote:

I just don't understand why you use class keyword here. This will
work without any changes, as-is, with plain function keyword. After
all, you just augment a constructor definition.

The body of this kind of function is different, in that it can define
instance properties and prototype methods.  It is valuable to
distinguish this syntactically, but also valuable to align with
expectations that developers currently have for using functions as
constructors.

This mail arrived late, that's why I did not reply to this. Nevertheless, I see no difference here. See the other mail, the function keyword is now primarily a tool to create constructor functions, and what's more important, your proposal does not _changes_something_existing_ nor _removes_ something - it just adds "public" as a way to define instance variables and prototype methods. You only add functionality to existing function syntax and semantics. I wpuld see this as bigger waste of class keyword (it does not add any real value - it just creates two things where one suffices, making language more complex) than other proposals where it is used for something really different than function body.

(of course, extends must be added to functions and semantics of <| should be fixed, but that is something I have told many times and no one seems to care)

Luke

Herby
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to