referents is attached Full Description |
|
Syntaxthis? referents indexer? (is | isnt) attached Purpose A referent is attached when its contents have been defined. However, the referent is no longer attached if a particular referent's contents have been specified, the referent has been closed, and the stream bound to that referent is subsequently discarded.
This code sample illustrates using the " macro attach-check token ref-name is do when referents ^ ref-name is attached output "attached%n" else output "not attached%n" done macro-end output referent "x" ; referent "x" is not attached attach-check "x" open s as referent "x" ; referent "x" is attached now attach-check "x" put s "some contents%n" ; still attached attach-check "x" close s ; still attached attach-check "x" discard s ; referent "x" is no longer attached attach-check "x" set referent "x" to "more contents%n" attach-check "x" ; attached now so we end up with a value |