You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every word is bound to global context by default at load time (source as text to Red values).
Local contexts are constructed at run-time.
Each context constructor will determine which words it should capture by either looking into a declared list (locals in functions), or gather all the set-words (objects).
Then, the constructor will go through the nested blocks in the body to bind all the “local” words. When applied in nested way object [... object [... func [...][...]]], the various binding passes will produce a result which mimic nested scopes.
That is what we call definitional scoping.
With dynamic scoping we have chains of function calls to traverse, with static scoping we have chains of definitions, but with definitional “scoping” there’s no chains at all, hence there’s no spoon scopes! Multiple rounds of bindings give an illusion of nesting (i.e. static scoping), while in fact all contexts are completely separate, w/o any hierarchy between them.