Next: Generic Dispatch, Previous: Continuations, Up: Procedures
Application hooks are objects that can be applied like procedures. Each application hook has two parts: a procedure that specifies what to do when the application hook is applied, and an arbitrary object, called extra. Often the procedure uses the extra object to determine what to do.
There are two kinds of application hooks, which differ in what arguments are passed to the procedure. When an apply hook is applied, the procedure is passed exactly the same arguments that were passed to the apply hook. When an entity is applied, the entity itself is passed as the first argument, followed by the other arguments that were passed to the entity.
Both apply hooks and entities satisfy the predicate procedure?
.
Each satisfies either compiled-procedure?
,
compound-procedure?
, or primitive-procedure?
, depending on
its procedure component. An apply hook is considered to accept the same
number of arguments as its procedure, while an entity is considered to
accept one less argument than its procedure.
Returns a newly allocated apply hook with a procedure component of procedure and an extra component of object.
Changes the procedure component of apply-hook to be procedure. Returns an unspecified value.
Changes the extra component of apply-hook to be object. Returns an unspecified value.
Returns a newly allocated entity with a procedure component of procedure and an extra component of object.