all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* About `setf' with macro call
@ 2013-04-17 13:21 xfq
  2013-04-17 14:06 ` Tassilo Horn
  0 siblings, 1 reply; 5+ messages in thread
From: xfq @ 2013-04-17 13:21 UTC (permalink / raw)
  To: help-gnu-emacs

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/



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-04-20  0:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-17 13:21 About `setf' with macro call xfq
2013-04-17 14:06 ` Tassilo Horn
2013-04-17 15:03   ` Stefan Monnier
2013-04-17 15:14     ` Tassilo Horn
2013-04-20  0:46       ` xfq

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.