-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom struct infrastructure #176
Labels
Comments
Also provide tuple as a special case of/wrapper around struct. Tuple works like struct but assumes property declarations are in order (cannot use object literal) and implements object destructuring. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Js structs have a number of disadvantages:
We could substitute our own syntax:
Only hard rule is:
@
is for static, no@
is instance.Provide some trait
intoProp
or something that contains normalization rules for properties that turn everything into aProperty({ init(), get(), set() })
. The normalization rule for undefined is to throw (to enforce explicit initialization). The normalization rule for Functions is binding on initialization and hiding from enumerable properties and so on.By default
.init(foo, bar, baz)
and.namedInit({ foo, bar, baz })
is provided.Highly flexible; metaprogrammable; supports reflection.
The text was updated successfully, but these errors were encountered: