From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.help Subject: Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'? Date: Sun, 10 Jan 2021 09:52:59 -0500 Message-ID: References: <87zh1kq97s.fsf@robertthorpeconsulting.com> <87czyekkfd.fsf@logand.com> <87a6thkv0y.fsf@logand.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20184"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: help-gnu-emacs@gnu.org To: Tomas Hlavaty Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Sun Jan 10 15:53:32 2021 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 1kyc5z-0005Av-P2 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 10 Jan 2021 15:53:31 +0100 Original-Received: from localhost ([::1]:48948 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kyc5y-0007yv-R7 for geh-help-gnu-emacs@m.gmane-mx.org; Sun, 10 Jan 2021 09:53:30 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42552) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyc5a-0007yi-85 for help-gnu-emacs@gnu.org; Sun, 10 Jan 2021 09:53:07 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:20772) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kyc5X-0001Mn-Or for help-gnu-emacs@gnu.org; Sun, 10 Jan 2021 09:53:05 -0500 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 0AC9A100225; Sun, 10 Jan 2021 09:53:02 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id AF5051000DA; Sun, 10 Jan 2021 09:53:00 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1610290380; bh=ozCMv/+ifqgQ8Z0xU0aChOEYjWOR4o7tK17AUseEJwA=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=muOAfCSBovo8Pks89nOMtreO4VVzlRA6yMqV89T6qf4veFSXvHGicuT9xxhglS01s rGn3ajKR/+5fKKu42FPAC9iRfqwzr6BQUIuCS+2w2XG4YmkJ6YQVjUHztg5QsdZqMW 31grFhCBPQF0qgUIDl7t3BBM6p87HOV+1AYFMBpg1zhFGp73FyGePoUIuGJJqCP+MC EC3DWUJDokZewxMn9+wqlYQVkmDFxdgBOHXZ0j05D3W1XUOb6NiGgc7tzlpA9+CO/m 8huWu722Il3Jvua8h1bKBPJryPcwzN+hb4BcU7co4pcTd+k3fKaG4Qyl9AJPdVl6mZ i/2TcSOxKS0cg== Original-Received: from alfajor (unknown [45.72.224.181]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 730CD120285; Sun, 10 Jan 2021 09:53:00 -0500 (EST) In-Reply-To: <87a6thkv0y.fsf@logand.com> (Tomas Hlavaty's message of "Sun, 10 Jan 2021 10:20:45 +0100") Received-SPF: pass client-ip=132.204.25.50; envelope-from=monnier@iro.umontreal.ca; helo=mailscanner.iro.umontreal.ca X-Spam_score_int: -42 X-Spam_score: -4.3 X-Spam_bar: ---- X-Spam_report: (-4.3 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_MED=-2.3, 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.23 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" Xref: news.gmane.io gmane.emacs.help:127162 Archived-At: > I see that Emacs Lisp does not have a way to distinguish the two cases. > > In Common Lisp, (declare (ignore i)) means ignore unused variable i. If > i is used, I get a warning. ELisp's equivalent is to use a variable name with a leading underscore such as `_i` (or just `_`). Stefan