Unsure about properties

    1. 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.
  • 2-4. Don’t mess with properties of types you don’t own. (S is yours, but not typeof(S)).
    1. The most obvious consequence is that you can’t tab-complete your properties in the REPL.
    1. You need to be very careful with only using getfield to access your real fields inside your getproperty and setproperty! implementations, to avoid performance traps.
2 Likes