From: Marc Battyani
Subject: macrolet vs #.
Date: 
Message-ID: <CAE9711E3E864327.BCE42CE36E07DDC7.2178DA23CBE03F04@lp.airnews.net>
What are the pros ans cons of using a macrolet or a #. in a function when
the macrolet or #. is used only once and the code is small.

Example:

(defconstant +slot-initargs+ '(:user-name :description :tooltip :stored
:indexed :null-allowed))

(defmethod clos::compute-effective-slot-definition-initargs ((class
fc-class) name direct-slot-definitions)
  (macrolet ((copy-slots (initargs)
        (loop for initarg in initargs
       nconc `(,initarg (,(intern (symbol-name initarg)) direct-slot)))))
    (let ((direct-slot (first direct-slot-definitions)))
      (append (copy-slots #.+slot-initargs+)(call-next-method)))))

vs:

(defmethod clos::compute-effective-slot-definition-initargs ((class
fc-class) name direct-slot-definitions)
  (let ((direct-slot (first direct-slot-definitions)))
    (append #.(loop for initarg in +slot-initargs+
      nconc `(,initarg (,(intern (symbol-name initarg)) direct-slot)))
     (call-next-method))))

Marc Battyani
From: Barry Margolin
Subject: Re: macrolet vs #.
Date: 
Message-ID: <koBu4.21$JG2.697@burlma1-snr2>
In article <··················································@lp.airnews.net>,
Marc Battyani <·············@csi.com> wrote:
>What are the pros ans cons of using a macrolet or a #. in a function when
>the macrolet or #. is used only once and the code is small.

IMHO, #. should only be used when it is absolutely necessary, when you're
in a context that requires a constant, you need to compute it, and it can
be computed at read time.

-- 
Barry Margolin, ······@bbnplanet.com
GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.