![]() | ![]() | ![]() | 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:
&whole argument is bound to the form argument that is passed
to defcm. The remaining lambda-list parameters are
specified as if this form contained the function name in the car and the
actual arguments in the cdr. However, if the car of the actual form is the
symbol funcall, then the destructuring of the arguments is actually
performed using its cddr instead.
compiler-macro) and to the compiler macro function.
&whole).
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
![]() | ![]() | ![]() | defcm | ![]() |