The Environment Object (.environment)

The Environment object is a directory of public objects that are always accessible. To place something in the Environment directory, use the form:
.environment~your.object = value

Include a period (.) in any object name you use, to avoid conflicts with current or future REXX entries to the Environment directory. To retrieve your object, use the form:

say .environment~your.object

To give your object definition limited retrievability, place it in .local, where the scope is the current process only.

Use an environment symbol to access the entries of this directory. An environment symbol starts with a period and has at least one other character, and its second character cannot be a digit. You have seen environment symbols earlier; for example in:

asav = .savings~new

.Savings is an environment symbol, and refers to the Savings class. The classes you create can be referenced with an environment symbol, and there is an environment symbol for each REXX-defined class, as well as for each of the unique objects this section describes, such as the NIL object.


[Back: Public, Local, and Built-in Environment Objects]
[Next: The NIL Object (.nil)]