3 ms·
Thanks! Pretty sure you can get progressive versions of this type of behavior (where obj["field"] is equivalent to obj[:field] or obj.field) by using Ruby's Ha
by yebyen 8y ago
Thanks!
Pretty sure you can get progressive versions of this type of behavior (where obj["field"] is equivalent to obj[:field] or obj.field) by using Ruby's HashWithIndifferentAccess and/or OpenStruct classes, but those are both obviously more obscure than something which is a built-in default language feature.
- samatman 8y agoIt's one of several decisions that make Lua's type system easy to reason about. Another one is that environments themselves are simply tables, the global is _G, and environments can be set and retrieved on functions. Kinda like mutable Mars ^_^