all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Juanma Barranquero <lekktu@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 8711@debbugs.gnu.org, Helmut Eller <eller.helmut@gmail.com>
Subject: bug#8711: 24.0.50; binding _ to unused values with lexical-binding
Date: Thu, 2 Jun 2011 15:41:32 +0200	[thread overview]
Message-ID: <BANLkTimKoC2b=_e09s5nd5W2Ev-w8X+XxA@mail.gmail.com> (raw)
In-Reply-To: <jwv1uzcjtlz.fsf-monnier+emacs@gnu.org>

On Thu, Jun 2, 2011 at 14:45, Stefan Monnier <monnier@iro.umontreal.ca> wrote:

> That's how dolist/dotimes are defined in Common-Lisp, hence that's
> how it works in cl-macs.  The subr versions also do it because when we
> introduced them, some people brought up the issue and it seemed there
> was no point in being incompatible.

I wonder what kind of code (other than a specific test) makes this
incompatibility noticeable in the first place... but I digress ;-)

> Yes, I do find it very odd as well, but CLHS says clearly "At the time
> result-form is processed, var is bound to nil".

Silly me, I should've checked the CLHS. I would still be puzzled, but
at least not by Emacs.

> Or she can just use different names rather than reusing the same
> variable name.

Yeah, that too.

>> so setting it to nil in the (dolist (VAR LIST RESULT) ...) case does
>> not bring any clear benefit, even in the non-lexical case.
>
> Agreed.

Well, at the very least that's something that could/should be
optimized away (at some point in the future, I mean) in the
lexical-binding case (I think we already have some macros that expand
to different code for lexical and non-lexical compilations?).

Meanwhile, will you complain if I change that particular case (in
doc-view.el) to be like

(let (...)
  (dolist (var list)
    ...)
  result)

to avoid the warning?

    Juanma





  reply	other threads:[~2011-06-02 13:41 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-21 18:44 bug#8711: 24.0.50; binding _ to unused values with lexical-binding Helmut Eller
2011-05-23  9:01 ` Lawrence Mitchell
2011-05-23 14:24   ` Stefan Monnier
2011-05-23 18:23     ` Helmut Eller
2011-05-23 19:29       ` Stefan Monnier
2011-05-23 20:16         ` Helmut Eller
2011-05-24  0:56           ` Stefan Monnier
2011-05-24  6:01             ` Helmut Eller
2011-05-24 12:42               ` Stefan Monnier
2011-06-02 11:17                 ` Juanma Barranquero
2011-06-02 12:45                   ` Stefan Monnier
2011-06-02 13:41                     ` Juanma Barranquero [this message]
2011-06-02 14:00                       ` Stefan Monnier
2011-06-02 17:10                         ` Juanma Barranquero
2011-05-23 20:32         ` Helmut Eller
2011-05-24  0:51           ` Stefan Monnier
2022-05-08 12:33 ` bug#8711: bug#26960: 26.0.50; Complaints about unused variable in cl-destructuring-bind Lars Ingebrigtsen
2022-05-08 13:32   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-05-09  9:25     ` bug#8711: " Lars Ingebrigtsen
2022-05-09 12:26       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='BANLkTimKoC2b=_e09s5nd5W2Ev-w8X+XxA@mail.gmail.com' \
    --to=lekktu@gmail.com \
    --cc=8711@debbugs.gnu.org \
    --cc=eller.helmut@gmail.com \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.