delq-oneGBBopen Toolsdefine-classdefcmGoTo Top

defcm   name lambda-list [[declaration* | documentation]] form* => name[Macro]

Purpose
Define a read-time conditional compiler macro.

Package   :gbbopen-tools

Module   :gbbopen-tools

Arguments and values

name     A non-nil, non-keyword symbol that names a function or macro
lambda-list     A lambda-list
declaration     A declare expression (not evaluated)
documentation     A documentation string (not evaluated)
form     A form

Returns
The supplied name.

Description
Defcm is a read-time conditional version of Common Lisp's define-compiler-macro. As with define-compiler-macro:

A compiler macro is not defined if the feature :disable-compiler-macros or the feature :full-safety is present when the expander function is executed on a form.

See also
    :disable-compiler-macros
    :full-safety

Example
Here is the compiler macro defined for ensure-list:

  > (defcm ensure-list (x)
      (with-once-only-bindings (x)
        `(if (listp ,x) ,x (list ,x))))
  ensure-list
  >


The GBBopen Project


delq-oneGBBopen Toolsdefine-classdefcmGoTo Top