add_exception_function,
add_echo_function
add_exception_function,
add_echo_function — assign functions for exceptions or echoes on a point.
add_exception_function (symbol, s_exp);
add_echo_function (symbol, s_exp);
symbolA point name, as a symbol.
s_expAny Gamma or Lisp expression.
When a Gamma or Lisp program is run in conjunction with a DataHub instance, process points may change at any time, causing point change events to occur. A point change event is referred to as an exception. It is possible to bind any Gamma or Lisp expression to a symbol to be evaluated when an exception occurs. If a program can both write a point on the DataHub instance and react to exceptions on that point, it is possible that the DataHub instance will "echo" a point written by the program itself. If this is not handled, an infinite loop between the program and the DataHub instance could occur. The DataHub instance tags point echoes so that a different function can be called in the program when that echo arrives back at its origin. Only the originating task will see a point exception as an echo. All other tasks will see a normal exception.
When an exception handler (the s_exp argument) is
being evaluated the special variables this,
value and previous are all bound:
this The symbol which received the exception.
value The current value of this as a result of
the exception.
previous The value of this immediately prior to the
exception.
Gamma>add_exception_function(#temp, #princ("temp change\n"));(princ "temp change\n")Gamma>add_echo_function(#temp,nil);nilGamma>next_event();temp change (t)Gamma>read_point(#temp);30Gamma>write_point(#temp,25);tGamma>next_event();(nil)Gamma>