You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As you point out, in the "Open Questions" section, the application of a single visibility token to all elements of a BindingList is likely to be misunderstood. In particular, I think that in all contexts (both declaration and use), the private sigil should immediately precede the identifier of a private field. An ES programer should never be allowed or required to write the name of a private field without including the sigil.
So, we should change the syntax to have a visibility token (the sigil or empty) per element, as you discussed. While we could impose the requirement that all elements of a binding list have the same visibility, I don't that it is actually necessary that we do so.
Decorators just have to be parametrized such that they can determine the visibility of the binding for each application. It would seem that they need this ability, independent of this proposal, in order to manipulate the different kinds of binding elements. For example, using the currently proposed syntax,
@foox=5;
@foo #y;
foo decorator function would need to be written such that it does the right fooish thing for the property x and for the private field #y (possibly erroring out for one of them). Given that, I don't see why processing:
@fooownx=5, #y;
would work any differently.
In addition, I think we should probably allow decoration of each individual element of a binding list such that
@fooown @readonlyx=5, #y;
would be semantically equivalent to
own @foo @readonlyx=5, @foo #7;
Because we are excluding prototype placement BindList declarations, we don't have to worry about the ambiguity that an empty ElementPlacement would create for this scheme.
Of course decorators aren't really part of this proposal, but we should design it as if they were.
The text was updated successfully, but these errors were encountered:
I agree with all but the last wrinkle. We should support
@fooownx=5, #y;
as you say. But we should not support
@fooown @readonlyx=5, #y;
If you want that, write separate declarations for each different set of annotations. Don't allow partial factoring -- it is too confusing and likely for readers to misinterpret.
As you point out, in the "Open Questions" section, the application of a single visibility token to all elements of a BindingList is likely to be misunderstood. In particular, I think that in all contexts (both declaration and use), the private sigil should immediately precede the identifier of a private field. An ES programer should never be allowed or required to write the name of a private field without including the sigil.
So, we should change the syntax to have a visibility token (the sigil or empty) per element, as you discussed. While we could impose the requirement that all elements of a binding list have the same visibility, I don't that it is actually necessary that we do so.
Decorators just have to be parametrized such that they can determine the visibility of the binding for each application. It would seem that they need this ability, independent of this proposal, in order to manipulate the different kinds of binding elements. For example, using the currently proposed syntax,
foo decorator function would need to be written such that it does the right fooish thing for the property x and for the private field #y (possibly erroring out for one of them). Given that, I don't see why processing:
would work any differently.
In addition, I think we should probably allow decoration of each individual element of a binding list such that
would be semantically equivalent to
Because we are excluding prototype placement BindList declarations, we don't have to worry about the ambiguity that an empty ElementPlacement would create for this scheme.
Of course decorators aren't really part of this proposal, but we should design it as if they were.
The text was updated successfully, but these errors were encountered: