Re: macro that writes macros



Sacha wrote:
how to get rid of these ','symbol things.

Try here:
http://bc.tech.coop/blog/041205.html

So what are you guys usually doing to avoid these ? Do you avoid these at all ?

I've been using them. The secret seems to be that the innermost
backquote is associated with the leftmost comma, but the comma
isn't evaluated. So backquote-comma pairing does occur for the
inner backquote, even though it's quoted by the outer backquote,
but evaluation of the comma does not occur. I guess the comma
is quoted because its backquote is quoted. But somehow that
doesn't prevent READ and/or EVAL from pairing them up.

(defvar bar :bar)
``(,foo ,',bar) => `(,FOO :BAR)

bar is eval'd because the second comma before it belongs to the
outer backquote, which is eval'd. foo is not eval'd because
its comma belongs to the uneval'd inner backquote. What I don't
understand is why the ,' before ,bar disappears. Even though
it's a no-op, it seems like something is automagically evaluating
or pruning it when it should be quoted.

--
Dan
www.prairienet.org/~dsb/
.



Relevant Pages

  • Re: macro that writes macros
    ... backquote is associated with the leftmost comma, ... inner backquote, even though it's quoted by the outer backquote, ... but evaluation of the comma does not occur. ... (defvar bar:bar) ...
    (comp.lang.lisp)
  • Re: ANN: TwinLisp - a new way of programming in Common Lisp
    ... You use the TwinLisp syntax within the templates, ... and it translates to a CL backquote. ... They are kind of like an enlarged, cheesy backtick and comma. ...
    (comp.lang.lisp)
  • Re: ANN: TwinLisp - a new way of programming in Common Lisp
    ... You use the TwinLisp syntax within the templates, ... and it translates to a CL backquote. ... They are kind of like an enlarged, cheesy backtick and comma. ...
    (comp.lang.lisp)
  • Re: nested quasiquote?
    ... textual scope of a comma belonging to the outer backquote. ... adding or subtracting one as parentheses are passed.) ... one belongs to the innermost backquote. ...
    (comp.lang.lisp)
  • Re: Setf macro macro
    ... is available at the time of first evaluation, that is, when the outer ... backquote is evaluated.'' (To use the value of r that is available at ... ,@,p means ``the value of p is a form; splice in the value of the ...
    (comp.lang.lisp)