From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stephen Berman Newsgroups: gmane.emacs.help Subject: Re: Check whether an object is an alist Date: Wed, 18 Sep 2024 00:01:34 +0200 Message-ID: <87cyl2uegx.fsf@gmx.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="9749"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: tomas@tuxteam.de, help-gnu-emacs@gnu.org To: Heime Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Wed Sep 18 00:02:27 2024 Return-path: Envelope-to: geh-help-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 1sqgHD-0002QD-BN for geh-help-gnu-emacs@m.gmane-mx.org; Wed, 18 Sep 2024 00:02:27 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqgGZ-0000Ry-PJ; Tue, 17 Sep 2024 18:01:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqgGX-0000Ho-9y for help-gnu-emacs@gnu.org; Tue, 17 Sep 2024 18:01:45 -0400 Original-Received: from mout.gmx.net ([212.227.17.20]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqgGV-0005YF-Hs for help-gnu-emacs@gnu.org; Tue, 17 Sep 2024 18:01:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1726610497; x=1727215297; i=stephen.berman@gmx.net; bh=y1YgevqrcsO8Tx3hIICfaDb+aE8fGJ8//XkjS60n8w8=; h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date: Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=tM9NC64rjx5ulYZfNgS4RRxdejNNkMDOQna79R7xlPWqDubB2pkt3IrRL9FzgcgP B/6JS+UZp0Kfci1YKkDmPigbdgZXQSugoguJ7fdGPDkkY2zBUxSMaf4s4PzVTJiyc Div/fAO3SRVVLTOjXb9XLpQ2/Q21Mseb3DTSY9xw7h9SGjDgdw8K/FydmVOi6TY8g C8Ue7ZwNXWtsnI5EcNgvTgC/01M25TFHpBwpSFAY0Y+gpMJAMo80WJa0pHVkG09mb 7UhLgj6vDd9/Ql1vSO14GhcLetPhD9LnAAfC5/ixkcVDmI1y96qa3++KiQxviOpj8 428dI4IeUeGrBNMFzw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from strobelfssd ([88.130.49.199]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Mkpap-1s7g580z31-00Zl4s; Wed, 18 Sep 2024 00:01:37 +0200 In-Reply-To: (Heime's message of "Tue, 17 Sep 2024 21:02:03 +0000") X-Provags-ID: V03:K1:jOu6/FmJjEWWegoHA0OrN1EKS2Qg63wvw8siGSKVDbwtcOKX+j0 G8ULL3GAosvLsuVBFtTwWLewg5yo5X2Jq5ekdOo3Z64BvqurB12Pj/8GRsnDztZtKokQBtg A3fZfDlh8x9z9tjQz5u4r0Z5ZEOd1lQkAvrR/rFAtxiBKbPJTOTvasMi8GLKHJtZYKvPiUM 3IcIFTWYebZ31YcKda4WQ== UI-OutboundReport: notjunk:1;M01:P0:rHu2yMNq7o8=;StDDMrR3IZoqhkbebIZQXXjqKwR ynJnslTB2KTByP9STmmm0c1J7EODE84HldpginaYOcTHbvc4MbKZgkxatszGjGX4FVA4NtdjU TUN+rtyLaNcRGyUIPzTNq+nOVugUfPASn3QK2uizElGh8cIn/VzGX8BnkigsNKqNFaIZqnkkk R/9s1CZ9EpaCjiawr/5Fq7AX6/3qjKdyjAIVtpZVmtnLqYndGjHFiSq9IvM0H16MW8Oj0CIzD 8Oe2JhbuHHrZjRWeEr+wOjlNKN2dHDJlpnPH63UmLeCvAb8j9UM51USRV/4MVDl56MG6iZ4Fu 73/5rW12y3C/G090t6/BAtWLnCq9RY1P7WH+oGI4xn87eD96evjWhY0KUi8mvrepGlWl3OI5u JQHMGEGcLMJGXaFr7Is8e70eMGUX8pVGzcpQIPOR0V9upENjpOspLU6Bd2VaFfFfGwVjmn2hK RnyA5bW3TjjJ85Ro+XiNy2Va3jy0b+Z3E6S8PlLnPbT3j7YcJjG1xDjF3ssLXcEs9Wpi+pWnY Ickb8GvCijrf7eni1tgiZ/ZHkYbrM4ZOqnqNSLHh8MjY7dhFczweHqXcLcImaw9hmQjeiRZ25 h9Mu2I+a0ziSGov78yUPOWIagyMFrWIcHLukrJOu+e+Se/pxeztR/PkR14CVUAAmlI6H5CRve URIm2i0fjodlXSuTiJTyN1Ck4f+r1GPNtsjMKDDYO8ScG2banT3jeIBj0qXMzBTT/x89dP/Fy viTawOyVGV56gDkeHx6Rs8Z9TBjhTiw5dYlbpoajblxQmXDzCEBtLIRZalNGfW7jUkHu0A6o Received-SPF: pass client-ip=212.227.17.20; envelope-from=stephen.berman@gmx.net; helo=mout.gmx.net X-Spam_score_int: -37 X-Spam_score: -3.8 X-Spam_bar: --- X-Spam_report: (-3.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-1.048, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148020 Archived-At: On Tue, 17 Sep 2024 21:02:03 +0000 Heime wrote: [...] > After changing to the following, I am getting validation for list=20 > element (1 2 3), even though it is not an association.=20 It is according to (info "(elisp) Association Lists"): Both the values and the keys in an alist may be any Lisp objects. For example, in the following alist, the symbol =E2=80=98a=E2=80=99 is as= sociated with the number =E2=80=981=E2=80=99, and the string =E2=80=98"b"=E2=80=99 is a= ssociated with the _list_ =E2=80=98(2 3)=E2=80=99, which is the CDR of the alist element: =20=20 ((a . 1) ("b" 2 3)) > (defun torium-alist-p (obj) > "Return t if object OBJ is an association list (alist)." > (and (listp obj) > (cl-every (lambda (x) #'consp) obj))) Steve Berman