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

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

bug#27016: possible bug in `defsetf'


From: npostavs
Subject: bug#27016: possible bug in `defsetf'
Date: Mon, 22 May 2017 17:18:32 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux)

tags 27016 - unreproducible
found 27016 24.4
found 27016 25.2
quit

Rafael D Sorkin <rsorkin@perimeterinstitute.ca> writes:

> Following your suggestion I tried starting with "emacs -Q" and
> got the same results as you did.  However if I (require 'cl)
> then the bug returns.  (I normally require CL automatically on
> starting emacs.)  So perhaps it's an incompatibility between CL
> and the new way that defsetf is implemented.

Oh, right, I see it now.  It happens in 24.4 and later.  I'm not sure
it's a bug though.  My guess is that the difference is eager
macroexpansion.  When I compile, then I get the same behaviour with 24.3
(that's my earliest working Emacs build) as well.

    $ emacs -Q -batch -l cl -f batch-byte-compile bug-27016-defsetf.el 

    In toplevel form:
    bug-27016-defsetf.el:1:1:Warning: cl package required at runtime
    bug-27016-defsetf.el:3:1:Warning: global/dynamic var `pair' lacks a prefix
    Wrote /home/npostavs/src/emacs/bug-27016-defsetf.elc
    $ emacs -Q -batch -l bug-27016-defsetf.elc
    pair: (0 . 4)

where bug-27016-defsetf.el has contents:

    (require 'cl)

    (defvar pair nil)
    (setq pair (cons 3 4))                  ; (3 . 4)
    (unless t
      (defalias 'foobar 'cons)
      (defsetf foobar setcar))              ; nil
    (setf (foobar pair) 0)                  ; 0       !

    (message "pair: %S" pair)






reply via email to

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