unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "白井 彰" <okshirai@gmail.com>
Cc: 14387@debbugs.gnu.org
Subject: bug#14387: 24.3; The return value of setf is not the last VAL in the list
Date: Tue, 14 May 2013 22:01:00 -0400	[thread overview]
Message-ID: <jwvk3n1knsd.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <E64A7F6F-B414-48C6-B4F4-41A73012783F@gmail.com> ("白井 彰"'s message of "Sun, 12 May 2013 01:40:49 +0900")

> (let ((pl '(aaa bbb))) (setf (cl-getf pl 'aaa) 'ccc))
> (aaa ccc)    ; This should be ccc

Oops, good point.  The patch below should fix it (installed in trunk).


        Stefan


=== modified file 'lisp/emacs-lisp/cl-extra.el'
--- lisp/emacs-lisp/cl-extra.el	2013-01-02 16:13:04 +0000
+++ lisp/emacs-lisp/cl-extra.el	2013-05-15 01:55:53 +0000
@@ -597,8 +597,11 @@
                   (macroexp-let2 nil d def
                     (funcall do `(cl-getf ,getter ,k ,d)
                              (lambda (v)
-                               (funcall setter
-                                        `(cl--set-getf ,getter ,k ,v))))))))))
+                               (macroexp-let2 nil val v
+                                 `(progn
+                                    ,(funcall setter
+                                              `(cl--set-getf ,getter ,k ,val))
+                                    ,val))))))))))
   (setplist '--cl-getf-symbol-- plist)
   (or (get '--cl-getf-symbol-- tag)
       ;; Originally we called cl-get here,






      reply	other threads:[~2013-05-15  2:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-11 16:40 bug#14387: 24.3; The return value of setf is not the last VAL in the list 白井 彰
2013-05-15  2:01 ` Stefan Monnier [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvk3n1knsd.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=14387@debbugs.gnu.org \
    --cc=okshirai@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).