Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!jpl-devvax!usenet From: charest@ai-cyclops.jpl.nasa.gov Newsgroups: comp.lang.lisp Subject: 'once-only' workalike Message-ID: <1991May30.205119.1147@jpl-devvax.jpl.nasa.gov> Date: 30 May 91 20:51:19 GMT Sender: usenet@jpl-devvax.jpl.nasa.gov (For NNTP so rrn will be able to post) Reply-To: charest@ai-cyclops.jpl.nasa.gov Organization: NASA/Jet Propulsion Lab Lines: 23 Nntp-Posting-Host: germanium 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