def-function-spec-handler

Macro

Package: excl

Arguments: symbol arglist &body body

def-function-spec-handler defines a new kind of function spec handler keyed on symbol, a symbol which is the fspec-first of the function spec. The handler must accept three arguments so arglist must be a list of three elements. The arguments are:

  1. The function spec, which may be in internal or external form. The external form is a list of two or three elements.
  2. The operation. The list of operations is given below.
  3. The extra argument. This argument will be used when needed and ignored when not needed. When the operation is setf, for example, the extra argument is the new value.

The body must return an appropriate value for the operation. The operations are:

:validateReturn a boolean indicating whether the place named by the spec exists. This must never signal error.
fboundpReturn the function if the function is defined and return nil if the function is not defined. An error must never be signaled on a validated function spec.
:setfableA boolean indicating whether setf is allowed.
setfSet the function to the third (extra) argument value.
boundpBoolean whether fmakunbound is allowed. Note that this is not the same meaning as the CL function boundp.
fmakunboundMake the function funbound.
blockFor certain functions (e.g. setf functions) defun is required to wrap the body in a block with a certain name. This operation must return the name based on the spec and is called by the defun macro and the compiler top level. This is a good place to put an error check for functions that may not be defined by defun.
uninternDetach the function-spec from its "oblist" for potential garbage-collection of the entire function spec. Does not do an fmakunbound; i.e. if an operation has squirrelled the function-spec away, it remains fully operational, just as unintern of an fboundp symbol still leaves it fboundp.

See Function specs in implementation.htm for more information on function specs.

The documentation is described in introduction.htm and the index is in index.htm.

Copyright (c) 1998-2000, Franz Inc. Berkeley, CA., USA. All rights reserved.

Created 2000.10.5.