home *** CD-ROM | disk | FTP | other *** search
- The compiler will now compile the form
- (*no-macroexpand* <form>)
- in a special way: if <form> is a function call, e.g. (name arg1 ...),
- then any macro properties of 'name' will be ignored for this
- invocation. This permits one to write macros which attempt
- an optimization, and if that fails, then call the standard
- function. *no-macroexpand* is not a function that can be called,
- thus forms with *no-macroexpand* are likely to be 'cmacros'.
- Here is an example:
-
- (defcmacro length (x &protect (x))
- `(if (null ,x)
- then 0
- elseif (null (cdr ,x))
- then 1
- else (*no-macroexpand* (length ,x))))
-
-
- [in case you are wondering, the `&protect (x)' means that
- should the actual argument to 'length' be a non atom, defcmacro
- will lambda bind the value, insuring that it is only evaluated
- once]
-
-
-
-
-