Previous: Continuations, Up: Procedures [Contents][Index]
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.
Returns #t
if object is an apply hook; otherwise returns
#f
.
Returns the procedure component of apply-hook.
Changes the procedure component of apply-hook to be procedure. Returns an unspecified value.
Returns the extra component of apply-hook.
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.
Returns #t
if object is an entity; otherwise returns
#f
.
Returns the procedure component of entity.
Changes the procedure component of entity to be procedure. Returns an unspecified value.
Returns the extra component of entity.
Changes the extra component of entity to be object. Returns an unspecified value.
Previous: Continuations, Up: Procedures [Contents][Index]