Does anyone have sources available for a work-alike implementation of the
'once-only' macro provided in Symbolics Common LISP? Recall that once-only,
when used in the body of a defmacro, guarantees to expand exactly once all of
the defmacro variables in its arglist.* The defmacro variables may be bound to
arbitrary LISP forms in the macro call. For example:
(defmacro double (x &environment env)
(once-only (x &environment env)
`(+ ,x ,x)))
(macroexpand '(double (foo-accessor bar)))
=> (let ((#:G666 (foo-accessor bar)))
(+ #:G666 #:G666))
*Note that I am not particularly interested in the 'code-analysis' feature of
Symbolics' version (wherein the value of each defmacro variable given to
once-only is bound to a gensym only if it is 'non-trivial').
Thanks in advance,
Len Charest
"In the rich man's house there is no place to spit but in his face."
-Diogenes
In article <·····················@jpl-devvax.jpl.nasa.gov> ·······@ai-cyclops.jpl.nasa.gov writes:
Does anyone have sources available for a work-alike implementation of the
'once-only' macro provided in Symbolics Common LISP?
There is one of these in the PCL sources. In the file macros.lisp I believe.