Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!iuvax!cica!tut.cis.ohio-state.edu!ucbvax!hplabs!well!nagle From: nagle@well.UUCP (John Nagle) Newsgroups: comp.lang.lisp Subject: Re: CL and lexical closures Message-ID: <12910@well.UUCP> Date: 29 Jul 89 15:53:15 GMT References: <638@laic.UUCP> Reply-To: nagle@well.UUCP (John Nagle) Distribution: usa Lines: 20 In article <638@laic.UUCP> ik@.UUCP () writes: - 3. [related to 2] Which of the following is more efficient? - - (defun store-fn (slot-name) - (setf (get slot-name 'lookup-fn) - #'(lambda (object) - (foo object slot-name)))) - - (defun store-fn (slot-name) - (setf (get slot-name 'lookup-fn) - (eval `(compile nil - #'(lambda (object) - (foo object ',slot-name)))))) - Since the second will invoke the compiler at run-time, it is highly undesirable in a production program. With KCL, this will result in a delay of a second or more as the compiler is loaded, and this will occur every time the function is invoked. John Nagle