|
|||||
Referents: copying | |||||
Prerequisite Concepts | Related Syntax |
A buffer or referent that has referents-allowed
can be written to any stream that has referents-allowed
or referents-displayed
. When a buffer or referent with referents-allowed
is written to a stream with referents-displayed
, OmniMark simply copies across the referents. for example, in either of
put foo stream bar put foo "%g(bar)"
If "bar" allowed referents when it was open, and had referents written to it and "foo" allows referents, then the referents from "bar", and not their "resolved" values are written to "foo". Those referents will be resolved in "foo" when "foo" needs to be written out to a file, or when a stream to which "foo" itself is written out, or never, if "foo" is never written out.
When a buffer or referent which contains referents is written to another stream that allows referents, the text in that buffer or referent is copied with all processing done in the context of the stream from which it is copied except that:
All other processing, including line breaking, is done at the time of the original write to the stream. Maximum line length checking is always done in the context of the stream to which referent-containing text is finally written.
If a buffer containing referents is written to a stream in which referents are allowed, it must be done with no format modifiers applied to the source stream, as those format modifiers require processing of the buffer's contents prior to copying them over. So the following would be in error:
put foo "%ug(bar)"
A stream that has referents-allowed
, but which is attached to a file or to an externally defined output stream, cannot be copied over to another stream with referents-allowed
. This restriction is because OmniMark does not have any guarantee that it has all of the file or externally defined output stream content available to it.
Referents can be written to referents, because referents are buffers. The only restriction is that a referent cannot be written to itself, directly or indirectly. This later condition is detected at run time when a stream to which the referent has been written has been resolved.
A buffer or referent to which referents have been written can also be written to a stream that has referents-displayed
. In this case all the referents in the buffer or referent are converted to "displayed" text prior to being copied over, so that the target stream only has text written to it.
The current value of a referent that contains referents can be written to any other type of stream, in the same manner as can the text of any other buffer.
Prerequisite Concepts Referents |
Related Syntax referents-allowed referents-displayed |
---- |