From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Drew Adams Newsgroups: gmane.emacs.devel Subject: RE: master 8f0f851: * lisp/autoarg.el: Use lexical binding. Date: Mon, 20 Apr 2020 07:55:27 -0700 (PDT) Message-ID: <026ef78c-3c5e-4fd8-8161-0cc2cf5771c0@default> References: <20200419004503.26161.91884@vcs0.savannah.gnu.org> <20200419004504.C65772049B@vcs0.savannah.gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="121367"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Juanma Barranquero , Emacs developers To: Stefan Monnier , Stefan Kangas Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Apr 20 16:56:51 2020 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 1jQXqs-000VS2-Tf for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Apr 2020 16:56:50 +0200 Original-Received: from localhost ([::1]:37314 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQXqr-0002TS-Vy for ged-emacs-devel@m.gmane-mx.org; Mon, 20 Apr 2020 10:56:50 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52844 helo=eggs1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jQXpp-0000uB-Bd for emacs-devel@gnu.org; Mon, 20 Apr 2020 10:55:45 -0400 Original-Received: from Debian-exim by eggs1p.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jQXpn-00061v-OS for emacs-devel@gnu.org; Mon, 20 Apr 2020 10:55:44 -0400 Original-Received: from userp2130.oracle.com ([156.151.31.86]:58796) by eggs1p.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jQXpn-000609-69 for emacs-devel@gnu.org; Mon, 20 Apr 2020 10:55:43 -0400 Original-Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03KEsEqO152350; Mon, 20 Apr 2020 14:55:31 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=mime-version : message-id : date : from : sender : to : cc : subject : references : in-reply-to : content-type : content-transfer-encoding; s=corp-2020-01-29; bh=51h3C9HDHMWCR/PYltP6cH3PsVTVfLjGN5+0dhwWE4A=; b=IYp6mU9uPQOb7n+17re0TlmFR6A8sTm8baSZzt20chb2whOWrxN7kUjV4+yf/qGAEsCf NUtiD7nSe0oQboWI8/NfEBgr6VfaZakpzC/pttYQT/w2WzplQ/wvUN8voUyr/h5OBG5j kEKnSLbyxhSNuOVN7OljorCVte9B64CoDI54c8uB3JIqGDFTvYMgxqZpxSgXUbCAEelo +wfieP5B+y/izG5lE08l7iK2NHfyeFauyPmn01LaMD0xvwC7k0aOZG4ao5DJuWYISaCz Fr4tHhs8Rrk1LSIX3olfnqDMHNFseIsOySIdnH2TSodh7aV4LjVwTxNisf9/vTcDbn2Z +Q== Original-Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 30grpgc6ha-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Apr 2020 14:55:31 +0000 Original-Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.42/8.16.0.42) with SMTP id 03KErNxK072158; Mon, 20 Apr 2020 14:55:31 GMT Original-Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 30gb8wn1d6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 20 Apr 2020 14:55:31 +0000 Original-Received: from abhmp0006.oracle.com (abhmp0006.oracle.com [141.146.116.12]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 03KEtSbn010662; Mon, 20 Apr 2020 14:55:30 GMT In-Reply-To: X-Priority: 3 X-Mailer: Oracle Beehive Extensions for Outlook 2.0.1.9.1 (1003210) [OL 16.0.4966.0 (x86)] X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9596 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=814 adultscore=0 bulkscore=0 suspectscore=0 malwarescore=0 phishscore=0 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004200126 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9596 signatures=668686 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=879 mlxscore=0 lowpriorityscore=0 adultscore=0 suspectscore=0 bulkscore=0 clxscore=1011 malwarescore=0 phishscore=0 spamscore=0 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004200126 Received-SPF: pass client-ip=156.151.31.86; envelope-from=drew.adams@oracle.com; helo=userp2130.oracle.com X-detected-operating-system: by eggs1p.gnu.org: First seen = 2020/04/20 10:55:39 X-ACL-Warn: Detected OS = Linux 3.x [generic] [fuzzy] X-Received-From: 156.151.31.86 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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" Xref: news.gmane.io gmane.emacs.devel:247390 Archived-At: > > I don't think I understand the original warning though. Same here. > > This minimized code example gives me "Unused lexical > > variable 'i'" when byte-compiled: > > > > (let (alist) > > (dotimes (i 10 alist) (push i alist))) >=20 > It's unused in the expression `alist`. So? (defun foo (a) (message "%s" a) 42) doesn't use `a' in the value returned. We don't warn about that, do we? > If you don't use `i` there, then you should do: > (let (alist) > (dotimes (i 10) (push i alist)) > alist) Doesn't seem right to have such a distinction. Is this just an implementation artifact (essentially a bug), or is there a good reason for the warning in the first case (and not in the second)? FWIW, all that Common Lisp says about its `dotimes' in this regard is this: "At the time result-form is processed, VAR is bound to the number of times the body was executed." Why should we warn, if the result form doesn't use the variable?