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: Mon, 23 Dec 2024 05:40:36 +0000 Message-ID: References: <865xnc6u9n.fsf@gnu.org> <87jzbs9jlk.fsf@gnu.org> 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="22821"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Anand Tamariya , emacs-devel@gnu.org, Stefan Monnier To: Tassilo Horn , Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Dec 23 06:41: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 1tPbC8-0005o2-C3 for ged-emacs-devel@m.gmane-mx.org; Mon, 23 Dec 2024 06:41:32 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tPbBO-00027x-8l; Mon, 23 Dec 2024 00:40:46 -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 1tPbBJ-00027b-4X for emacs-devel@gnu.org; Mon, 23 Dec 2024 00:40:41 -0500 Original-Received: from mail-ed1-x52c.google.com ([2a00:1450:4864:20::52c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tPbBH-000318-Jy; Mon, 23 Dec 2024 00:40:40 -0500 Original-Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-5d3d0205bd5so5141026a12.3; Sun, 22 Dec 2024 21:40:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734932437; x=1735537237; 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=bpRLzkH7FF+IalJf6hyfC2okKZ3RBxMSPeiEXnEFf8Y=; b=Wuc30eckin0xnVyuj22mr6o2BPPmpcoNeXdwYxZved5GobuzGwTUbfe1vQUsqK3RmZ E1xIwCcZXziMlpnS7G9oz6wX9TtbtHMtz4bE5l8sMyIlZdbca8AQFTlYjZEn988S+RJk uz8WD+JDu9QgXBhsFHTUzJTuC5066kSwpX7c1MSp1uUCiYPKm/xMpw54DkSxMab6aYQg JQLeu1A6TPBtgJn8JCqvgGRXBQA31Q5xluQ0e+bsCIjbi4dTwh2fBVrWlnC8ggGU2kKZ /TFm6Ak8/nSUXLgoifWd69XP0dkm97iihxPTKfDu7b/Is4lb6kanObN9EyPrMXOuKS81 1qew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734932437; x=1735537237; 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=bpRLzkH7FF+IalJf6hyfC2okKZ3RBxMSPeiEXnEFf8Y=; b=PX7GJBndKtjFVj2O+qRlEngKBZ3Dc9en4kLPNurbv0ZmsnG6QdBQOU7rtibwinQvcr +CidHLC7D26wfsqaqAPxQS+FrLyXXYOD7sR++PHdPzYmZWB8CCcTj7Y6UqApd/gX/38o v+SCch16y9CHBBfs32zdq0Fn1tGfoJjgrGgKUUErOzH1CUlT2IOnIxFirYZOiBWZnpoR KGmFNajNF9zjHVLtHdx1sD5j8H1hKkC2S2TJke/TsojhvDiyCXwf5RA59DS7v69vV9Xw I1LLeYYlHsi/Gd/FihuqGefKOKDy4cMNGJgH5DPADFe+CZmSJbHSeYtbRcPvSjVZ7jMU dgoQ== X-Forwarded-Encrypted: i=1; AJvYcCVNVeGplYW/txm6zP4GrbNfaHysA5cagerewv9zhiyCy3lD8Ay8QCVDNDOlYh04sBOJ8yIS@gnu.org, AJvYcCVjslIUK/1XFq4ep+FrtEfxX+W5+zuWF60WkzvTV8hMwSmN4eBjZuNpq4UY4vcNJez+h3qsblk7g+mQc/I=@gnu.org X-Gm-Message-State: AOJu0Yyw7xxd/xXQc3IMWBPdI4gnvKFfMyagcEynuOkmni+hPsa0gptj XaVHDxAKiN+20SHNu6cauc9VzFyg1jVNIsQhWCWFSi78T87QYf1ywOkHFZvDTtS+8HehhYHLJCo YXskfBsPlSRF3v1BMCVj8gTNwRkG7gMFU X-Gm-Gg: ASbGncuXOTxH6lqqwiv2+m0m4E7Y+MvLJoOTHjZyr3DLtXBnG08r+eQqZ64U5uI5XAI Kr6iuoo9aHsFVy7hJajXl2You3pPjhkJW4VdXABI2 X-Google-Smtp-Source: AGHT+IGX6eZo56gfAikJhIHaLCB2nTTaURgK0jytSmC+zYrWbyi4POzpV8jcQ1/969efeBhxDNMf1RxAarLoSYCpIG0= X-Received: by 2002:a05:6402:84c:b0:5d0:b925:a8a with SMTP id 4fb4d7f45d1cf-5d81dda80bemr12193895a12.16.1734932436698; Sun, 22 Dec 2024 21:40:36 -0800 (PST) Original-Received: from 753933720722 named unknown by gmailapi.google.com with HTTPREST; Mon, 23 Dec 2024 05:40:36 +0000 In-Reply-To: <87jzbs9jlk.fsf@gnu.org> Received-SPF: pass client-ip=2a00:1450:4864:20::52c; envelope-from=stefankangas@gmail.com; helo=mail-ed1-x52c.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:326899 Archived-At: Tassilo Horn writes: > Eli Zaretskii writes: > >>> Should negative index for nth be valid? e.g. >>> (nth -1 '(1 2)) returns 1 >> >> What does this do in other Lisps? > > In CL, it errors (ditto for nthcdr with negative index). Same for (nth > '(1 2 3) -1) in Clojure or (list-ref '(1 2 3) -1) in Scheme. Stefan Monnier, any comments here?