[previous] [up] [next]     [contents] [index]
Next: Unit Utilities Up: Invoking and Opening Units Previous: Invoking and Opening Units

Examples

These examples use the definitions from the earlier unit examples in section 7.1.1 and section 7.1.3.

Invoking f1@, f2@, or f3@ produces the same result:

  (invoke-unit f1@) ; displays and returns the current time 
However, invoking and opening f1@ binds a different global variable than invoking and opening f3@:
  (invoke-open-unit f1@) ; displays and returns the current time
  x ; => time that was displayed
  (invoke-open-unit f3@) ; displays and returns the current time
  x ; => still time that was displayed by invoking f1@
  A:x ; => time that was displayed by invoking f3@
  (invoke-open-unit f1@) ; displays and returns the current time
  x ; => time that was displayed by most recent invocation of f1@ 


PLT