state caches fuzzy_names but does not remember when name does not exist
da-h opened this issue · 1 comments
da-h commented
Note: Maybe, state
should only allow predefined variables?
da-h commented
The behavior, namely disabled caching for in
-calls if the variable is not existent should not change.
Note: A change would be possible but would require a more complicated procedure on state changes. (See below).
Example that shows why this behavior is intended:
- The module
moduleCaller
asks for"var" in state
, but the variable is created in another module AFTERmoduleCaller
asks for it. So let's assume thatmoduleSetter
callsstate["var"] = 42
sometime later. - Since
moduleCaller
asked forstate["var"]
before setting the variable,moduleCaller
caches that the variable does not exist. Any further seach in the form"var" in state
would always returnfalse
with caching enabled, unless eachstate
change makes sure that ALL module-state-caches are adapted. - alternatively, caching is always off if the variable was not found. (as it is now)