From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Andrea Corallo Newsgroups: gmane.emacs.bugs Subject: bug#71120: 29.3; buglet in cl-loop Date: Thu, 30 May 2024 09:14:24 -0400 Message-ID: References: <23fd70f8-6e01-45d7-b9f9-d81d53c95ffd@lmf.cnrs.fr> <87cyp4wdj7.fsf@posteo.net> <4ED83CF1-C697-46DF-99D2-56432A1E3B44@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="11149"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 71120@debbugs.gnu.org, Philip Kaludercic , Stefan Monnier , Philippe Schnoebelen To: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu May 30 15:15:19 2024 Return-path: Envelope-to: geb-bug-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 1sCfci-0002gA-OE for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 30 May 2024 15:15:16 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sCfcM-0006Em-MN; Thu, 30 May 2024 09:14:54 -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 1sCfcL-0006ET-6o for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 09:14:53 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sCfcK-0007Fk-U0 for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 09:14:52 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sCfcU-00007D-4y for bug-gnu-emacs@gnu.org; Thu, 30 May 2024 09:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Andrea Corallo Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 30 May 2024 13:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71120 X-GNU-PR-Package: emacs Original-Received: via spool by 71120-submit@debbugs.gnu.org id=B71120.1717074885387 (code B ref 71120); Thu, 30 May 2024 13:15:02 +0000 Original-Received: (at 71120) by debbugs.gnu.org; 30 May 2024 13:14:45 +0000 Original-Received: from localhost ([127.0.0.1]:35054 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCfcC-00006A-Sv for submit@debbugs.gnu.org; Thu, 30 May 2024 09:14:45 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52166) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sCfcA-00005n-0C for 71120@debbugs.gnu.org; Thu, 30 May 2024 09:14:43 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sCfbt-0007Er-BS; Thu, 30 May 2024 09:14:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:Date:References:In-Reply-To:Subject:To: From; bh=QUptmOyDq7A5bWvlnKcGADZ3rgvuo94Fz5HtlW6vdmw=; b=IGBqEgQAHZDNTXdeTEiY RuPSa6pvbtPW4cvJ0Eu+tIaaDsbWYklAOuBQd1G+uj4Tlba957AQV6zz7ZUQCbOUWuf6okENQxOdu 3D6u3gmBqu0waOSvoNuDlDpQDfunltbs2drwlxRAqpZ5Theq83LTTjcVgaCVmrdEaUt9cD09hMN57 MaseMkbvuTDChFyxQK65O4QjDUKcjsCo/nC+jXMT5Z12TvnNOkIfOfL/HKWjJsEPadEi7gRVSWAaa DNAVbBmZF5VKfJpfo3WXXVBqfZLu5DHXSopnFGdbh4FvMRwY721uDUEm1OZFh1WYutm3RmgM0rESQ 4uOogkKnEcGjDA==; Original-Received: from acorallo by fencepost.gnu.org with local (Exim 4.90_1) (envelope-from ) id 1sCfbt-0006mF-0u; Thu, 30 May 2024 09:14:25 -0400 In-Reply-To: <4ED83CF1-C697-46DF-99D2-56432A1E3B44@gmail.com> ("Mattias =?UTF-8?Q?Engdeg=C3=A5rd?="'s message of "Thu, 30 May 2024 11:25:46 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:286222 Archived-At: Mattias Engdeg=C3=A5rd writes: > Philippe Schnoebelen writes: > >> When I need a list of 100 random dice throws I write >>=20 >> (cl-loop for i from 1 to 100 collect (random 6)) >>=20 >> It compiles just fine. >>=20 >> If instead I use >>=20 >> (cl-loop for _i from 1 to 100 collect (random 6)) >>=20 >> then I get a compilation warning: >>=20 >> foo.el:1:18: Warning: variable =E2=80=98_i=E2=80=99 not left unused > > Quite unfair that you have no a priori way of knowing whether your variab= le name is actually the one that `cl-loop` uses for iteration or just one b= ound for each iteration (as in `dotimes`). > > A sloppy reading of Common Lisp's `loop` spec, which we don't need to fol= low since this isn't CL but we'd be fools to deviate too far from without a= good reason, didn't tell me anything. > > In particular nothing about whether the user is allowed to alter the vari= able in order to change the iteration. For example, what should > > (cl-loop for i from 1 to 100 > when (=3D i 3) do (setq i 98) > collect i) > > return? Perhaps better not touch that. If the spec doesn't say anything usually means it's left to the implementors (IOW it's UB). > Thus I don't think there's anything we really need to do here, do you? I, for one, think the nicest option is the one SBCL (and I guess other CL implementations) are using, that is to have 'i' 'ignorable', the problem is that we don't support this at language level. Andrea