From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Kangas Newsgroups: gmane.emacs.devel Subject: Re: Negative nth index Date: Wed, 25 Dec 2024 08:23:59 -0600 Message-ID: References: <865xnc6u9n.fsf@gnu.org> <87jzbs9jlk.fsf@gnu.org> <87r05wahsi.fsf@protonmail.com> <350E9109-04F6-4C20-B0F6-37C0A482DAD3@gmail.com> <87ed1w9glz.fsf@protonmail.com> <5D930F52-CD28-4E5E-89B2-1E9DC3945011@gmail.com> <87y1039aoa.fsf@protonmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32398"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Tassilo Horn , Eli Zaretskii , Anand Tamariya , emacs-devel@gnu.org To: Pip Cet , =?UTF-8?Q?Mattias_Engdeg=C3=A5rd?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 25 15:24:32 2024 Return-path: Envelope-to: ged-emacs-devel@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 1tQSJL-0008En-Eu for ged-emacs-devel@m.gmane-mx.org; Wed, 25 Dec 2024 15:24:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tQSIw-0002qy-7N; Wed, 25 Dec 2024 09:24:06 -0500 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 1tQSIu-0002qn-7q for emacs-devel@gnu.org; Wed, 25 Dec 2024 09:24:04 -0500 Original-Received: from mail-ed1-x52e.google.com ([2a00:1450:4864:20::52e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tQSIs-0008Kf-M2; Wed, 25 Dec 2024 09:24:03 -0500 Original-Received: by mail-ed1-x52e.google.com with SMTP id 4fb4d7f45d1cf-5ceb03aadb1so8088495a12.0; Wed, 25 Dec 2024 06:24:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1735136640; x=1735741440; darn=gnu.org; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:from:to:cc:subject:date:message-id:reply-to; bh=rqIN5eFQUKDIaIpkmVko68rV3mazRw1+1brtxK29oSI=; b=PeA1aMrUERUQbVbkHlBaH8ipjJcnfqdWxMga7LGaCeUG1q0m+XZrh3l9F3EesrRRNW 4mx1niLKWHh0R/hSDxoJZgj7sLxW/d31RYnjWydwowXLiINaVEZd4j4PtvV5QZbbpIHX QVgbcgNSq03Fm+Uhf3aAFjoLoOvrx9GIDuVKigs5av/lGhEt7Ch2UXDvX8BqKLV1JOK/ +wT78yXrySwQIf6aHa85GkXIm02BJ350/87RuihE8YreGkWZGpwYjEZ4wiVYdfpghghT IVqqGAzKkZqrhXvmq3QmL6vg2hFIk2cudniDKe+c+6UtzT7ibtI8NqjJrrsti0Be8uTB Qtsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1735136640; x=1735741440; h=cc:to:subject:message-id:date:mime-version:references:in-reply-to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rqIN5eFQUKDIaIpkmVko68rV3mazRw1+1brtxK29oSI=; b=jSLvjH6CKZeQnypYc6vfqnJKyeqDw+yiKYpN0+tA2BD35OgtfN6m9x5tOuS/vMVQOq uYdTKQDjZoipe0FSSaYHKVA3fiC83nHww3vTRBZqjGcXMlFknML+Yi6FKN+71Jx1Dr+p wxdh3ueWFiVpBdw6rMDsrxAHE72BklSNUIPoWVHg7TvB44r9Ed21UK1SQYRYhFuhssld p3/XHeM/niq1G08SGW74X+gpTmwbdAEZ396yBm3gqsT7RzhdhiqnRIF/OosVt0IUDKOr 0MpDxYwHvHenH9nLZT7VRBvIQ9jVq99JySzQsl8uJZnUJ1UMyxX70ZcaTFA99Bw8gALj 63TA== X-Forwarded-Encrypted: i=1; AJvYcCWA7oJBU9MVwMNG5E5aCymlr2NBWPHjq7CT1+fdziarwJ/Teiz+VWS30AmOeAxieCsbe0GWjxf7uk7rVHk=@gnu.org, AJvYcCWDNA+vSAO+zOcOWvfHYfrMbtTvYJRFpcHOfDinQRcydcKq0tja2lC2p3g8t6Cyhv/o4PaJ@gnu.org, AJvYcCWEE8C5JZq7KrR1R/yFNUjtuo5OVy16B2vOySp4pJ6FdOvFyeS2GRaa/5KpE4QY3VnjXHtzOw==@gnu.org X-Gm-Message-State: AOJu0YwGJ4NMJbrsS5AP4dn+SYZeD5fXTjElwpOw5GDUhO+y5h1Em+m5 CXDjSKZRFE8MAT94YQqfKhHYKQ2KfRFx7JNNJYPUbakn8QDxO1B9NndVIkOwGDJl0suUtZX8H0g 88VaJyZy+DZjWXQG9sm5zvWXO+J/0b4sv X-Gm-Gg: ASbGncujFAcgkebr13k6q1TRBf0oIgbnH2yYpzGYJ0tRKw+9OLmjpaC66QHog8ZbgYP A9NjBpzE0vOcsTjZh0tCHx5hpTgWOws8jCt3ViHcW X-Google-Smtp-Source: AGHT+IFE+2DSZrISBcYJLS/ePf6/ek9vBA+prq2ZHWb6h0aiDdtWqK5m3tKVIHfDQSG4h3+NwWuMFY+X8yoT635Oo3Y= X-Received: by 2002:a05:6402:3482:b0:5d0:b879:fa36 with SMTP id 4fb4d7f45d1cf-5d81dd63c57mr17297127a12.7.1735136640251; Wed, 25 Dec 2024 06:24:00 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Wed, 25 Dec 2024 08:23:59 -0600 In-Reply-To: <87y1039aoa.fsf@protonmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::52e; envelope-from=stefankangas@gmail.com; helo=mail-ed1-x52e.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: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 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-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:327098 Archived-At: Pip Cet writes: > I didn't know that. We specifically undocumented it in 2013, as it > turns out (3e6b67c9b7230bf10219082d9215d9617a33715e): > > 2013-08-13 Glenn Morris > > * lists.texi (List Elements): > Undocument behavior of nth and nthcdr with n < 0. (Bug#15059) > > I agree with the statement in that bug thread: All hope is lost. We > can't fix it and it is broken, and now we're stuck with permanent harm. > The only thing it's good for now is to serve as a cautionary tale. We could warn in the byte-compiler, at least for constant arguments (as futile as that would be), or we could introduce a new runtime warning. But I'm not exactly sure that it would be worth the trouble. >>> If it were merely undocumented, I might agree, but the current behavior >>> doesn't match the documentation, >> >> Yes, the manual and doc strings could certainly be improved. > > By reverting that commit? Perhaps the least intrusive thing we could do is to document the current behavior, and say that this is an unfortunate historical accident that no Lisp program should ever rely on.