From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.devel Subject: Re: member inconsistency? Date: Thu, 28 Jan 2016 11:25:33 +0100 Message-ID: <871t929f1e.fsf@gmx.net> References: <87twly2iye.fsf@nicolasgoaziou.fr> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1453976764 4604 80.91.229.3 (28 Jan 2016 10:26:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 28 Jan 2016 10:26:04 +0000 (UTC) Cc: Philipp Stephani , Nicolas Goaziou , emacs-devel@gnu.org To: Andreas Schwab Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Jan 28 11:25:54 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1aOjly-0002yz-Oy for ged-emacs-devel@m.gmane.org; Thu, 28 Jan 2016 11:25:54 +0100 Original-Received: from localhost ([::1]:55126 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOjlu-0002Fe-EP for ged-emacs-devel@m.gmane.org; Thu, 28 Jan 2016 05:25:50 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53722) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOjlp-0002FT-QN for emacs-devel@gnu.org; Thu, 28 Jan 2016 05:25:46 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aOjlk-00052l-Oh for emacs-devel@gnu.org; Thu, 28 Jan 2016 05:25:45 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:50052) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aOjlk-00052V-FR for emacs-devel@gnu.org; Thu, 28 Jan 2016 05:25:40 -0500 Original-Received: from rosalinde ([89.245.82.29]) by mail.gmx.com (mrgmx102) with ESMTPSA (Nemesis) id 0M0smx-1a665n0T1T-00v9tK; Thu, 28 Jan 2016 11:25:36 +0100 In-Reply-To: (Andreas Schwab's message of "Thu, 28 Jan 2016 11:14:37 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) X-Provags-ID: V03:K0:B4TMXs5u9ZV2c4G3XBIzhoWwPo7vC6AuxVYY+0Ki/KNDW5P+PtQ BbJD/oXKmv/xQJ/dZcQylIsJar0xhhANUz0LjncL89+ydoj4UbkBDMG0tPxW4ds3oujIVdb Djty8PLGTmyQD373RqBtSznFfWewPCjs9EF4Kn4beMDtKGYFILX7vyHctpEIIqsGD9odkuh 7i9h2hV01r3H+4gNZjbIQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:YOa/xcveO6A=:EGQz+iSV990SwM18jLRxvP 2ZSjdxZgqu4usvfyAQzdjdLXz+BRaG0yDG30ap2QQHX86oIFb3+yDdan9fNU1rFNcR8J+izev lKqBTvj71Kgiw7ludM2OXqmIqQ12Hb/WU4tOjkhjU4u8azZHh/mrN5gmgx6YIMT2qwb9xv66r 2TEjBmVKCjkF5ixwYgO8WX6XhIxH+2Q4nAm1u2h7LWBZWHHh2SbjWQzlTSMuDlhKGjekSv1kC ufTCz8PUuvSjBS4inEWyk5qt9n19Fk5XzkcXN5fl2CwN9muzjRSZQpvmtVy1EY0hu4GL8XBKn IURGzCEtWEHNGyWaTE7skZoLR5lYio/KIbgCeGjC7bZTnAuQdZ1iVVZZcuxbACaUroBX/lIiU /kB8x8cbYKtw/oqMTtfUJ/7+7Rp0rSHwCcgcvDiEgDAR7PQYG11GlyReZDkjS2wxuKdPI31eA 2elo80stAyCOHmxINUGmJzEDLg8Y1NNFnJpsACsFqwNOn9+9ssloJYDpAwlsXmiDoLMJ29rRV CaMKbeaWb7WKjHXMJiHSBiMnAtYovPBxI4WT5vw7MenLAwk1ChVFQKwKuJnfhU0Y3ITtZQbO1 ht0bWRglY+lVQlqdcrRxjRNN8HgIFF+RDXU1Rf02YwSpVi5DuguDHijYDiUZtnGHInYZc7w8z nFfVA4hG90rMz28nMhZ5+pcMPEUuZ5hF3JLiGxCoxh36V/cO53tt5/Dhg5g9HZvyKrVrXNOpA JAcjmWr/7MXN6NHlfqBp8o+0mhBTVdRC1F1Fgi+KJyzZEFC+w+ahjfoVbTTXIbC3O4usIcu3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.17.20 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:198940 Archived-At: On Thu, 28 Jan 2016 11:14:37 +0100 Andreas Schwab wrote: > Philipp Stephani writes: > >> Nicolas Goaziou schrieb am Do., 28. Jan. 2016 um >> 09:41 Uhr: >> >>> Hello, >>> >>> The following behaviour is surprising >>> >>> (assq 'a 'b) => #ERROR >>> (memq 'a 'b) => #ERROR >>> (assoc 'a 'b) => #ERROR >>> >> >> For completeness, memql and assq have the same behavior. > > memql works like member if looking for a float, like memq otherwise. The definition of `memq' calls CHECK_LIST (list) and `assq' and `assoc' return CAR (list), and each of these signals the error in case of a wrong type. In contrast, `member' (and `memql' in the float case) has no check and also uses a for-loop with the condition CONSP (tail), and when this fails, the function just returns Qnil. Adding CHECK_LIST (list) before the for-loop makes (member 'a 'b) signal an error. (Instead of a for-loop, the other three use while (1), so the loop always runs and the type checks get executed.) Steve Berman