Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!bloom-beacon!think!barmar From: barmar@think.COM (Barry Margolin) Newsgroups: comp.lang.lisp Subject: Re: Use of backquote & macro question Message-ID: <39782@think.UUCP> Date: 28 Apr 89 16:06:10 GMT References: <2277@perseus.sw.mcc.com> Sender: news@think.UUCP Reply-To: barmar@kulla.think.com (Barry Margolin) Organization: Thinking Machines Corporation, Cambridge, MA Lines: 39 You are correct that backquote only works in an evaluation context. On p.349 of CltL, it says "Note that the [resulting] form is equivalent only in the sense that when it is evaluated it will calculate the correct result." Backquote expands into a form that constructs the specified data structure, but it has to be invoked somehow. If it's used in a non-evaluation context, it will simply be left there. For instance, a possible expansion of `(a ,b c) is (list (quote a) b (quote c)). If this were used in a let-binding, e.g. (let `(a ,b c) ...) the result will be (let (list (quote a) b) ...) which will bind the variables LIST and B to NIL, and bind the variable QUOTE to the value of A. Note, however, that you can frequently solve this problem by restructuring the expression. What was probably mean above was something like `(let (a ,b c) ...) which uses the value (at macro-expansion time) of B as the let-binding. Barry Margolin Thinking Machines Corp. barmar@think.com {uunet,harvard}!think!barmar