unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#34941: 27.0.50; map-inplace and map-not-inplace errors
@ 2019-03-22  2:20 Michael Heerdegen
  2019-03-22  9:34 ` Nicolas Petton
  2019-03-23  0:14 ` Michael Heerdegen
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Heerdegen @ 2019-03-22  2:20 UTC (permalink / raw)
  To: 34941; +Cc: Nicolas Petton


Hi,

in *scratch* I eval for testing

  (map-put! nil 1 1)

and get the error message

  map-put!: Cannot modify map in-place: %S: ((1 . 1))

I guess this "%S" in the error definition doesn't work as intended, it
is printed literally - likewise for the map-inplace error I guess.

And IMHO the code outputs the value of the wrong variable:

      (let ((oldmap map))
        (setf (alist-get key map key nil (or testfn #'equal)) value)
        (unless (eq oldmap map)
          (signal 'map-not-inplace (list map)))))
                                         ^^^

with OLDMAP that would make more sense IMO.  To be clear, the error
message I would expect would be

  map-put!: Cannot modify map in-place: nil


TIA,

Michael.


In GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.5)
 of 2019-03-21 built on drachen
Repository revision: acf2e0691e64b94185c493defb281ef280087d7a
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12003000
System Description: Debian GNU/Linux buster/sid






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

* bug#34941: 27.0.50; map-inplace and map-not-inplace errors
  2019-03-22  2:20 bug#34941: 27.0.50; map-inplace and map-not-inplace errors Michael Heerdegen
@ 2019-03-22  9:34 ` Nicolas Petton
  2019-03-22 15:09   ` Michael Heerdegen
  2019-03-23  0:14 ` Michael Heerdegen
  1 sibling, 1 reply; 7+ messages in thread
From: Nicolas Petton @ 2019-03-22  9:34 UTC (permalink / raw)
  To: michael_heerdegen, 34941

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

close 34941
tags 34941 fixed
thanks

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hi,

Hi Michael,

> with OLDMAP that would make more sense IMO.  To be clear, the error
> message I would expect would be
>
>   map-put!: Cannot modify map in-place: nil

I fixed both issues in master (commit 4174409c53), let me know if it
doesn't work for you.

Cheers,
Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* bug#34941: 27.0.50; map-inplace and map-not-inplace errors
  2019-03-22  9:34 ` Nicolas Petton
@ 2019-03-22 15:09   ` Michael Heerdegen
  2019-03-24 20:54     ` Nicolas Petton
  2019-03-27  9:23     ` Nicolas Petton
  0 siblings, 2 replies; 7+ messages in thread
From: Michael Heerdegen @ 2019-03-22 15:09 UTC (permalink / raw)
  To: Nicolas Petton; +Cc: 34941

Nicolas Petton <nicolas@petton.fr> writes:

> I fixed both issues in master (commit 4174409c53), let me know if it
> doesn't work for you.

Thanks.  You forgot to change map-inplace:

  (map-insert 'x 1 1)

  |- map-insert: Can only modify map in place: %S: x


Michael.





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

* bug#34941: 27.0.50; map-inplace and map-not-inplace errors
  2019-03-22  2:20 bug#34941: 27.0.50; map-inplace and map-not-inplace errors Michael Heerdegen
  2019-03-22  9:34 ` Nicolas Petton
@ 2019-03-23  0:14 ` Michael Heerdegen
  2019-03-23  1:59   ` Stefan Monnier
  1 sibling, 1 reply; 7+ messages in thread
From: Michael Heerdegen @ 2019-03-23  0:14 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Nicolas Petton, 34941

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Hi,
>
> in *scratch* I eval for testing
>
>   (map-put! nil 1 1)
>
> and get the error message
>
>   map-put!: Cannot modify map in-place: %S: ((1 . 1))
>
> I guess this "%S" in the error definition doesn't work as intended, it
> is printed literally - likewise for the map-inplace error I guess.

Stefan, some similar error definitions are from you.  Are these mistakes
or does this %S thing work in some context?


;;; *** /home/micha/software/emacs/lisp/emacs-lisp/cl-generic.el

;;;; Line 636
(define-error 'cl--generic-cyclic-definition "Cyclic definition: %S")


;;; *** /home/micha/software/emacs/lisp/emacs-lisp/cl-macs.el

;;;; Line 3094
(define-error 'cl-struct-unknown-slot "struct %S has no slot %S")


;;; *** /home/micha/software/emacs/lisp/emacs-lisp/gv.el

;;;; Line 77
(define-error 'gv-invalid-place "%S is not a valid place expression")


Thanks,

Michael.





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

* bug#34941: 27.0.50; map-inplace and map-not-inplace errors
  2019-03-23  0:14 ` Michael Heerdegen
@ 2019-03-23  1:59   ` Stefan Monnier
  0 siblings, 0 replies; 7+ messages in thread
From: Stefan Monnier @ 2019-03-23  1:59 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: Nicolas Petton, 34941

> Stefan, some similar error definitions are from you.  Are these mistakes
> or does this %S thing work in some context?

I plead guilty!

> (define-error 'cl-struct-unknown-slot "struct %S has no slot %S")

But the "correct" definition makes the error much less readable here :-(


        Stefan





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

* bug#34941: 27.0.50; map-inplace and map-not-inplace errors
  2019-03-22 15:09   ` Michael Heerdegen
@ 2019-03-24 20:54     ` Nicolas Petton
  2019-03-27  9:23     ` Nicolas Petton
  1 sibling, 0 replies; 7+ messages in thread
From: Nicolas Petton @ 2019-03-24 20:54 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 34941

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Nicolas Petton <nicolas@petton.fr> writes:
>
>> I fixed both issues in master (commit 4174409c53), let me know if it
>> doesn't work for you.
>
> Thanks.  You forgot to change map-inplace:

Yep, thanks for noticing, I'll fix it.

Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

* bug#34941: 27.0.50; map-inplace and map-not-inplace errors
  2019-03-22 15:09   ` Michael Heerdegen
  2019-03-24 20:54     ` Nicolas Petton
@ 2019-03-27  9:23     ` Nicolas Petton
  1 sibling, 0 replies; 7+ messages in thread
From: Nicolas Petton @ 2019-03-27  9:23 UTC (permalink / raw)
  To: Michael Heerdegen; +Cc: 34941

[-- Attachment #1: Type: text/plain, Size: 127 bytes --]

Michael Heerdegen <michael_heerdegen@web.de> writes:

> Thanks.  You forgot to change map-inplace:

I just pushed a fix.

Nico

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 487 bytes --]

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

end of thread, other threads:[~2019-03-27  9:23 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-22  2:20 bug#34941: 27.0.50; map-inplace and map-not-inplace errors Michael Heerdegen
2019-03-22  9:34 ` Nicolas Petton
2019-03-22 15:09   ` Michael Heerdegen
2019-03-24 20:54     ` Nicolas Petton
2019-03-27  9:23     ` Nicolas Petton
2019-03-23  0:14 ` Michael Heerdegen
2019-03-23  1:59   ` Stefan Monnier

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).