Subject: Re: printing the name of a var. in a macro^
From: rpw3@rigden.engr.sgi.com (Rob Warnock)
Date: 2000/05/17
Newsgroups: comp.lang.lisp
Message-ID: <8fttif$bt2pv$1@fido.engr.sgi.com>
Barry Margolin  <barmar@genuity.net> wrote:
+---------------
| >> > (defmacro setv (v value)
| >> >    `(progn (format t "setting ~S~% to ~S" v ,value)
| >> >             (setf ,v ,value)))
| >> Try this:
| >> (format t "setting ~S~% to ~S" ',v ,value)
| >
| >thank you. that easy.. :-)
| 
| Beware of what this will do if the VALUE form has side effects.  E.g. take
| a look at (macroexpand '(setf a (incf b))).  Solving the problem is an
| exercise for the reader.
+---------------

Didn't you mean, "LET the reader beware"...?  ;-}  ;-}

(Sorry, couldn't resist.)


-Rob

-----
Rob Warnock, 41L-955		rpw3@sgi.com
Applied Networking		http://reality.sgi.com/rpw3/
Silicon Graphics, Inc.		Phone: 650-933-1673
1600 Amphitheatre Pkwy.		PP-ASEL-IA
Mountain View, CA  94043