is attached

operator

Return type:
Switch
Returns:
true if the stream is attached to a destination and false otherwise. Replacing is with isnt will reverse the result.
Syntax
stream (is | isnt) attached 
or
#current-output (is | isnt) attached 
or
#current-input (is | isnt) attached


Purpose

is attached is a test used to determine whether a stream is attached to a destination.

Usage Notes

A stream can have three states:

  • unattached, the initial state,
  • opened, or
  • closed.
When a stream is attached, its destination can be any one of five types:

The is attached test can also be applied to #current-input, to determine when #current-input can supply data. In addition to this, the is attached test can be applied to a value string sink or value markup sink function argument, to determine when the argument can receive data or signals.

Related Concepts