-
Notifications
You must be signed in to change notification settings - Fork 5
Scopes
Scopes
Scopes can be debugged by setting the -Ddollar.debug.scope=true flag.
There are two types of scopes that Dollar uses, compile time scopes which are attached to dynamic vars using var#setMetaObject("scope",scope) and runtime scopes which are created on an adhoc basis.
Compile time scopes, which are attached to source nodes (see DollarSource), are duplicated upon use, using Scope#copy() and the parent is changed to the current scope, so that each execution of the scope is isolated. This is not necessary for runtime nodes (typically created using DollarScriptSupport#inScope) as they are not shared between executions.
If a var returned from an execution does not have a Scope associated the current scope is attached to it using
var#setMetaObject("scope",scope)
The Wiki is used for language design and developer notes, not for documentation. Please see https://sillelien.github.io/dollar for the language docs.