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: Rafael D Sorkin
Subject: bug#27016: possible bug in `defsetf'
Date: Mon, 22 May 2017 02:39:28 -0400

Hi, 

The second behavior below seems like a bug to me.  It was not
present in emacs 23.1

Best wishes, 
Rafael Sorkin


emacs-version                           ; 23.1.1
(setq pair (cons 3 4))                  ; (3 . 4)
(foobar pair)                           ; Symbol's function definition is void: 
foobar
(setf (foobar pair) 0)                  ; No setf-method known for foobar 
(unless t
  (defalias 'foobar 'cons)
  (defsetf foobar setcar))              ; nil 
(foobar pair)                           ; same as above
(setf (foobar pair) 0)                  ; same as above
pair                                    ; (3 . 4)


emacs-version                           ; 24.5.1
(setq pair (cons 3 4))                  ; (3 . 4)
(foobar pair)                           ; Symbol's function definition is void: 
foobar
(setf (foobar pair) 0)                  ; (foobar pair) is not a valid place 
expression 
(unless t
  (defalias 'foobar 'cons)
  (defsetf foobar setcar))              ; nil 
(foobar pair)                           ; same as above
(setf (foobar pair) 0)                  ; 0       !
pair                                    ; (0 . 4) !


~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-
 Rafael Sorkin
 Perimeter Institute for Theoretical Physics
 31 Caroline Street North
 Waterloo, ON  N2L 2Y5
 Canada
~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-






reply via email to

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