emacs-devel
[Top][All Lists]
Advanced

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

Re: 31395511: "Don’t attempt to modify constant strings"


From: Dmitry Gutov
Subject: Re: 31395511: "Don’t attempt to modify constant strings"
Date: Fri, 5 Jun 2020 20:14:12 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

On 05.06.2020 18:25, João Távora wrote:
But if you evaluate it, that doesn't happen, which is probably even
worse.

And this is even stranger, IMO:

     (defun example-bug2 ()
       (eq (make-text-button
                      "example" nil
                      'action (lambda (_) (message "action 1")))
           (make-text-button
                      "example" nil
                      'action (lambda (_) (message "action 2")))))
(defun example-bug3 ()
       (eq "example" "example"))
(defun example-bug4 ()
       (let ((str1 "example")
             (str2 "example"))
         (eq str1 str2)))
(list (example-bug2) (example-bug3) (example-bug4))

   when compiled, last form returns (t nil t)   in emacs 27,
   when compiled, last form returns (nil nil t) in emacs 28.
   when evaluated, last form returns (nil nil nil) in emacs 28.

For comparison, example-bug4 is valid Common Lisp and will return nil in
every Common Lisp implementation I know (I tested with ACL and SBCL),
regardless of whether compiled or evaluated.  I'm reasonably confident
there's somewhere in the Hyperspec where that behaviour may be specified
(I trust some CL pope will find it for me;-)  )

FWIW, it's a non-intuitive limitation for me as well.

But you can give bug#40671 a read, so see some context you might be missing.



reply via email to

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