|
|||||
Referent set nesting depth | |||||
Prerequisite Concepts | Related Syntax |
using nested-referents
can be nested within other using nested-referents
-- and in any case, a using nested-referents
is nested within the referent set created for the program as a whole (which is provided by OmniMark by default). Any stream that is opened within a referent set, with referents-allowed
, has with it associated a nesting depth which is the current nesting depth at the time the stream was opened.
The nesting depth of a referent that is identified using the referent
or referents
keywords is always the current nesting depth. The nesting depth of a referent identified by the name of a stream to which the referent is attached may be something other than the current nesting depth.
The fact that referents and streams exist at different levels imposes some constraints on which referents can be written to which streams. In general, the following regulations all come down to "you can't grab the value of a referent before it's defined".
using nested-referents
scope. This is because in this case the thing attached to the stream cannot continue to be a referent on exit from the using nested-referents
-- a referent cannot exist outside of its set. What happens to a referent attached to a stream whose name is more global than its referent set (and which is closed) is that it becomes "unattached", in the same manner that a closed stream attached to a referent becomes unattached when another stream is opened attached to the same referent.
using nested-referents
declaration can only be used in one domain. This ensures that the lifetime of any action prefixed by a using nested-referents
must either be properly nested within the lifetime of any other such using nested-referents
or be properly disjointed with the lifetime of any other such using nested referents
.
The provisions made above for local referent sets also apply to the "global referent set".
global
variable is effectively a local
variable in the set of a separate compilation unit.
using nested-referents
surrounding all programs at the global level.
Prerequisite Concepts Referents |
Related Syntax global, local open referents-allowed set referent using nested-referents |
---- |