From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#47427: 26.3; 1. Please define a built-in predicate `plistp', 2. wrong type wrong-type-argument error Date: Sun, 28 Mar 2021 14:50:21 +0200 Message-ID: <878s67788i.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20603"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: 47427@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 28 14:51:11 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lQUso-0005CL-Pz for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Mar 2021 14:51:10 +0200 Original-Received: from localhost ([::1]:60142 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lQUsn-0007HU-8k for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 28 Mar 2021 08:51:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:47902) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lQUsh-0007HO-Dg for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 08:51:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:33964) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lQUsf-0007lt-MT for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 08:51:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lQUsf-0001XZ-Js for bug-gnu-emacs@gnu.org; Sun, 28 Mar 2021 08:51:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 28 Mar 2021 12:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 47427 X-GNU-PR-Package: emacs Original-Received: via spool by 47427-submit@debbugs.gnu.org id=B47427.16169358365888 (code B ref 47427); Sun, 28 Mar 2021 12:51:01 +0000 Original-Received: (at 47427) by debbugs.gnu.org; 28 Mar 2021 12:50:36 +0000 Original-Received: from localhost ([127.0.0.1]:45510 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQUsG-0001Wu-Fn for submit@debbugs.gnu.org; Sun, 28 Mar 2021 08:50:36 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:55224) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lQUsE-0001We-GE for 47427@debbugs.gnu.org; Sun, 28 Mar 2021 08:50:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=6EaBz/lyR4Gbr9MxkZirmyInqvoYshS/epEfklyh8+0=; b=JTggaEX81trjDRNOfYeDdaV75U hCiTHIbb5JjG0LGc6w8DEkHVM3yi3emg6zCH41WJM8pdUeXGiAfoBWMX/9UNALCIfNKOnoAdWHq4K zh38VDRdLPNgfBJfFYTNO7l0sfYLTERCS84ptqXTYkcny0cFXfwhqdo2eYIbyHbvS+lI=; Original-Received: from cm-84.212.220.105.getinternet.no ([84.212.220.105] helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lQUs1-0001zH-T5; Sun, 28 Mar 2021 14:50:27 +0200 X-Now-Playing: Bobbie Gentry's _The Girl From Chickasaw County (5): Touch 'Em With Love_: "Seasons Come, Seasons Go" In-Reply-To: (Drew Adams's message of "Fri, 26 Mar 2021 22:27:00 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:203155 Archived-At: Drew Adams writes: > (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'. The backtrace there doesn't seem to be a result of the example form, but, yes, the error here isn't very good. Adding a `plistp' predicate would perhaps make sense, but it would just be (and (listp list) (zerop (mod (length list) 2))) and then we have the philosophical issue of "is nil a plist"? Does anybody have any opinions? > 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. Here you probably meant to say: (plist-put (list 'a 'b 'c) 'a 42) And that does indeed not result in any errors, but it's not because of the stringiness of anything, but because 'a exists in the list, and plist-put doesn't check whether the list is a plist in that case. Only when adding new elements does it check: (plist-put (list 'a 'b 'c) 'd 42) This signals an error. -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no