Next: , Previous: , Up: lang   [Index]


1.11 Running lists of functions

The library (vicare language-extensions hooks) exports an API defining hooks: opaque Scheme objects, disjoint from other types, referencing a list of functions which can be applied to arguments at a specified point in a program. Vicare Scheme hooks are somewhat similar to GNU Guile hooks.

Function: make-hook

Build and return a new hook object.

Function: hook? obj

Return #t if obj is a hook object, otherwise #f.

Function: hook-empty? hook

Return #t if hook is a hook object and it is empty, otherwise #f.

Function: add-hook! hook proc
Function: add-hook! hook proc last?

Register proc as hook function; return unspecified values. If last? is #f or not used: the new function is registered as first, else it is registered as last.

Function: remove-hook! hook proc

Remove a previously registered hook function. Return unspecified values.

Function: reset-hook! hook

Remove all the previously registered hooks.

Function: hook->list hook

Return the list of registered functions.

Function: run-hook hook arg

Run all the hook functions applying them to the given arguments. Return unspecified values.