help-gnu-emacs
[Top][All Lists]
Advanced

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

About `setf' with macro call


From: xfq
Subject: About `setf' with macro call
Date: Wed, 17 Apr 2013 21:21:19 +0800

In (info "(cl) Setf Extensions"), there is a example about using `setf'
on a macro call:

  (defmacro wrong-order (x y) (list 'aref y x))
  (setf (wrong-order A B) 17)

I evaluated these two expressions, and debugger entered:

  Debugger entered--Lisp error: (void-variable B)
    (let* ((v B) (v A)) (aset v v 17))
    (setf (wrong-order A B) 17)
    eval((setf (wrong-order A B) 17) nil)
    eval-last-sexp-1(nil)
    eval-last-sexp(nil)
    call-interactively(eval-last-sexp nil nil)
    command-execute(eval-last-sexp)

I understand that `A' and `B' are two invalid S-expressions here.  But I
don't understand the `let*' expression in the backtrace.  Does it store
into the element of `B' or `A' at index `A' the value 17?

I'd like to search the web, but I don't know how.  Any ideas?

--
Best regards, Xue Fuqiao.
http://www.gnu.org/software/emacs/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]