-
- Sure, you can use
_as a field name so I don’t see why you couldn’t use it as a property name. Either case is kind of user unfriendly though, since property destructuring,(; _) = S(), puts your field into a write-only variable.
- Sure, you can use
- 2-4. Don’t mess with properties of types you don’t own. (
Sis yours, but nottypeof(S)). -
- The most obvious consequence is that you can’t tab-complete your properties in the REPL.
-
- You need to be very careful with only using
getfieldto access your real fields inside yourgetpropertyandsetproperty!implementations, to avoid performance traps.
- You need to be very careful with only using
2 Likes