define-behavioris a special form for defining continuous behaviors that are enabled and disabled by splats. Behaviors are generally closed-loop control laws that do not have discrete action semantics.
(name . args)
(name . args)binding form operates like the equivalent part of the
define-splatspecial form. name is bound to a function of arguments args which returns an object of type
<splat-behavior>. In order to enable the behavior, the method
(enable behavior)must be called. To stop the behavior, use the method
The variables listed in the args list are in scope throughout
the body of the
define-behavior form, as is the variable
self, which refers to the
object returned by the function bound to name
(local-vars (arg val) ...)
local-varsform operates identically to the
define-behaviorform of the same name.
(enable . body)
enablemethod is called on the behavior. The thread running the
controlfunction is guaranteed not to start until after the
(disable . body)
disablemethod is called on the behavior. The
controlfunction is guaranteed not to run after the
disablefunction is called.
(control . body)
(check-for-disable self)at each iteration. If the
disablemethod has been called,
check-for-disablewill not return and the thread controlling the behavior will be terminated. The thunk defined in the
disableform will be called immediately before the thread exits, after
check-for-disablehas been invoked. Local variables defined in the
local-varsform keep their values.