Ideas on type hinting and named parameters
erights at gmail.com
Wed Jun 10 17:46:22 UTC 2015
On Wed, Jun 10, 2015 at 8:59 AM, Jeff Morrison <lbljeffmo at gmail.com> wrote:
> Instead, the purpose of initializers outside of the constructor are to
> increase expressivity in a different sense than what I think you meant
> about constructor initialization: It allows initialization that isn't based
> on logic in the constructor to be visually and clearly separate from logic
> that is.
So let's put a visually distinct syntax *in* the constructor. The
constructor is no longer as-if a function in several ways already. In for a
penny, in for a pound.
> It is strictly less expressive for constructor-injected state patterns,
In case I was not clear, I am not for using the current
assignment-in-constructor to pun initializing in constructor, the way Java
does. Initialization and assignment should be distinct. Const private
instance fields must be initialized but must not be assigned to.
> but it is strictly more expressive for other patterns of initialization.
What do you have in mind?
> I'm wary of adding syntax whose primary motivation is to express type
> constraints, when we haven't even defined (or proposed) what typing in JS
> es-discuss mailing listes-discuss at mozilla.orghttps://mail.mozilla.org/listinfo/es-discuss
> es-discuss mailing list
> es-discuss at mozilla.org
Text by me above is hereby placed in the public domain
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the es-discuss