[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Elementary question about backquote in T.

    I hope it is okay to send a T question to this list, since I am not aware
    of a separate list for T.


    If we define:

        (define-macro (bar x) `(list ,(car x)))

    then (macro-expand '(bar '(1 2)) *scratch-env*) ==> (list quote). That is, an
    attempt to evaluate (bar '(1 2)) will give an error to the effect that
    quote is unbound.

No mystery.   Arguments  to  macros aren't evaluated.  You're taking the
CAR of the list (QUOTE (1 2)), which is the symbol QUOTE.

           >  (set x '(1 2))
          ;; x is bound to '(1 2)

No.  X is bound to (1 2).