Feature Request: Declare new variables inside existing expressions
-
@toggledbits food for thought (and I hope I haven't already proposed this)... Could references to global expressions be expanded such that declared variables inside them could be accessed?
Example:
varEx := varInner = [1,2,3], varInner[2]
// returns 3Currently:
varB := varEx.varInner
// returns (null)Proposed:
// returns (array) [1,2,3]Thoughts? I'm increasingly using these hybrid definitions that are neither "pure" array nor object. I also like keeping my inventory of expressions compact.
-
I'm concerned that although you say you "like keeping [your] inventory of expressions compact," what you will in fact do by being able to create variables on-the-fly from within other variables/expressions is create a long and decidedly not compact inventory of variables created by whatever other expressions are declared, thus complicating your understanding of where they came from, how they got their value, and when they change. That will also further complicate the system's ability to know what changes affect what variables where and need to trigger evaluations of rules, etc. In your example above, I'm sure you would expect, if
varInner
was in fact agetEntity()
call, that any change to the entity would trigger a re-evaluation ofvarInner
, as well as its parent rule and everywhere it or an effected parent is used. It's too much, and the potential for creating unsupportable nightmare scenarios too high. -
T toggledbits locked this topic on