unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#47427: 26.3; 1. Please define a built-in predicate `plistp', 2. wrong type wrong-type-argument error
@ 2021-03-26 22:27 Drew Adams
  2021-03-28 12:50 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Drew Adams @ 2021-03-26 22:27 UTC (permalink / raw)
  To: 47427

 (plist-put (list 'a 'b 'c) "a" 42)

Debugger entered--Lisp error: (wrong-type-argument plistp (a b c))
  plist-put((a b c) "abc" 42)
  eval((plist-put (list (quote a) (quote b) (quote c)) "abc" 42))

That's all fine and dandy, except that there is no predicate `plistp'.

See (elisp) Type Predicates:

  All built-in functions do check the types of their actual arguments
  when appropriate, and signal a 'wrong-type-argument' error if an
  argument is of the wrong type.

It makes no sense to refer to `plistp' in the error message if it
doesn't exist.  If it won't exist then the error message should say that
the arg isn't a plist - not mention `plistp'.  Even just saying "plist"
in the error message would be an improvement in this regard.  But the
right fix is to define a `plistp' primitive.

Not only that, but the error is _not_, apparently that the first
arg isn't a proper plist.  For example, this raises no error:

 (plist-put (list 'a 'b 'c) "a" 42)

And it returns the list (a 42 c).  Clearly the error was raised
not because of an improper plist but because the key to look up
is a string and the keys in the almost-plist are symbols.

In GNU Emacs 26.3 (build 1, x86_64-w64-mingw32)
 of 2019-08-29
Repository revision: 96dd0196c28bc36779584e47fffcca433c9309cd
Windowing system distributor `Microsoft Corp.', version 10.0.19041
Configured using:
 `configure --without-dbus --host=x86_64-w64-mingw32
 --without-compress-install 'CFLAGS=-O2 -static -g3''






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

end of thread, other threads:[~2022-06-27 10:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-26 22:27 bug#47427: 26.3; 1. Please define a built-in predicate `plistp', 2. wrong type wrong-type-argument error Drew Adams
2021-03-28 12:50 ` Lars Ingebrigtsen
2021-03-28 16:39   ` bug#47427: [External] : " Drew Adams
2021-03-28 17:15     ` Lars Ingebrigtsen
2021-03-28 18:25       ` Drew Adams
2021-03-28 18:27         ` Lars Ingebrigtsen
2021-03-28 18:35           ` Drew Adams
2022-06-27 10:37   ` Lars Ingebrigtsen

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