Forum Discussion
EnTerr
11 years agoRoku Guru
"NewManLiving" wrote:Yeah... no. There is no way for such references to be resolved in advance in dynamic languages like Lua or BrightScript, where X.Y is just a shortcut for X["Y"] and not a numeric offset inside a record. You don't know what's in `m` till you get to `m`.
It would all depend on how the compiler resolves references. If it's a good compiler then it will resolve the reference at compile time. It would be nice to have an official word.
"NewManLiving" wrote:That's the way to do it, yep. Luckily here laziness in typing co-insides with efficiency.
As a side note. If I have something like m.a.b.c in a loop or where I use it over a number of times I presently resolve it myself. l_var = m.a.b.c.