From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: tpeplt Newsgroups: gmane.emacs.help Subject: Re: [External] : Undefined behavior for the function =?utf-8?B?4oCYbGFzdOKAmQ==?= or an error? Date: Mon, 01 Apr 2024 14:35:30 -0400 Message-ID: <87a5md9bil.fsf@gmail.com> References: <87il119g8u.fsf@gmail.com> 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="10652"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "help-gnu-emacs@gnu.org" To: Drew Adams Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 01 20:36:07 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 1rrMVq-0002YC-SI for geh-help-gnu-emacs@m.gmane-mx.org; Mon, 01 Apr 2024 20:36:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rrMVM-0006wv-PW; Mon, 01 Apr 2024 14:35:36 -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 1rrMVK-0006wn-8s for help-gnu-emacs@gnu.org; Mon, 01 Apr 2024 14:35:34 -0400 Original-Received: from mail-yw1-x1131.google.com ([2607:f8b0:4864:20::1131]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rrMVI-0004h8-T3 for help-gnu-emacs@gnu.org; Mon, 01 Apr 2024 14:35:34 -0400 Original-Received: by mail-yw1-x1131.google.com with SMTP id 00721157ae682-61448d00c59so19729807b3.0 for ; Mon, 01 Apr 2024 11:35:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711996532; x=1712601332; darn=gnu.org; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Dg9roiGW5/WWdx9em0ZL/PQHonnfwUUJ8/ewmin1u/E=; b=neMRCFU1J4JhkDnQrRHXx56jTyIe5WSknkslcADImSLMlOzpSP5XPbxxGZRmulM1I+ u6JbEM1Vn4iMFaNE8paBD8S6NfqDq6XHbQ1UKgro1BMZL0QzvubNnStqYOTgDCWBVes8 whEsKwxMR0dIarAkR6HfIcdcKsu8ib1/rTZlidSIm7kpGe6CpW6JGj0cnZ8grwqTat64 kwgneo0LxhqdS49t2FrTE/YFVaVbzsg2vwcRxM+Gqd3iCaHVA6PUo/cqiiAIFlzZkTac GnsdGtZDhHyLQdx9tYbHl/rSFvkBWGnIq7A+CEkke4KduF5n29iEuWMeNG1wGr9FPcO7 T3eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711996532; x=1712601332; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=Dg9roiGW5/WWdx9em0ZL/PQHonnfwUUJ8/ewmin1u/E=; b=k2pSPnn103hwd/oxTO4qbUp1Xpi68x+U0ENk8UelJwtwDk2ASNeUebF1PgB7CHsBC6 6bFbpK2hFgcv8fpJfq4CdQtK1ftgV/fjtI4u4ec4FMeX0t0G2Tro8Xolx98wmIwLWPil anU33znoYIfM1XL3shvx51+XIbNiyT0DArta+y3bQrJRX0cwsXzHpNF2LpkKm/pQfW6h JH5xzINpegVZ/wzQeNqdFRPfNCGbYooI9IC2eLLnxpy9gzIkQTMc+bZcb95mPk6ZN5pH TE7h3HHBbQh4rHm8WTnUc7s3RneqG/eiKZNetWIhjLJ7poDvOLZB4+cLABDVF6qoMGxP ZZpg== X-Gm-Message-State: AOJu0YyMY4uKs46xMV6di4reLcQViz9wlHXkwdIMzfCW2mp2lRYvWhhH ouASOl7edoRk3X2o3ya4qdott/7YfQ5Zuo2Iot2TN+kQ0TW3PgHk0br98dtSwi0= X-Google-Smtp-Source: AGHT+IFVUYm8lPSd9Rj/Q6eGc24t5DxfzYm6elvfS3S1n+TupHmuWt5BiR7cZ/Y5SMaPB1HbJ2WhEA== X-Received: by 2002:a81:b652:0:b0:615:17a8:c4e4 with SMTP id h18-20020a81b652000000b0061517a8c4e4mr365858ywk.0.1711996531817; Mon, 01 Apr 2024 11:35:31 -0700 (PDT) Original-Received: from t530.local ([2600:8806:a821:2b00::5acf]) by smtp.gmail.com with ESMTPSA id o4-20020ae9f504000000b0078a001f7fd8sm3674056qkg.6.2024.04.01.11.35.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Apr 2024 11:35:31 -0700 (PDT) In-Reply-To: (Drew Adams's message of "Mon, 1 Apr 2024 17:28:02 +0000") Received-SPF: pass client-ip=2607:f8b0:4864:20::1131; envelope-from=tpeplt@gmail.com; helo=mail-yw1-x1131.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_NONE=-0.0001, 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:146222 Archived-At: Drew Adams writes: > > IMO this should be fixed. Someone(TM) will > maybe say it's intentional (but then it > should be doc'd). > Also, if it is intentional, then it should be documented why it is inconsistent with how the related functions =E2=80=98butlast=E2=80=99 and = =E2=80=98nbutlast=E2=80=99 behave so that users do not expect those two functions to accept non-lists as an argument. Also, checking a few other list functions, =E2=80=98nthcdr=E2=80=99, =E2=80= =98take=E2=80=99, and =E2=80=98ntake=E2=80=99, there is a similar inconsistent result that might = be intentional or not. The behavior of =E2=80=98nthcdr=E2=80=99 is unexpected= , while the behavior of =E2=80=98take=E2=80=99 and =E2=80=98ntake=E2=80=99 are unpredic= table because these are Emacs-Lisp-specific functions. (nthcdr 0 'a) =3D> a (nthcdr 1 'a) =3D> a *** Eval error *** Wrong type argument: listp, a (take 0 'a) =3D> nil (take 1 'a) =3D> nil *** Eval error *** Wrong type argument: listp, a (ntake 0 'a) =3D> nil (ntake 1 'a) =3D> nil *** Eval error *** Wrong type argument: listp, a --