unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: Juanma Barranquero <lekktu@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Lexical binding
Date: Mon, 04 Apr 2011 17:44:30 -0400	[thread overview]
Message-ID: <jwv7hb91yud.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <BANLkTinvkFgKBjLMPE9-xNdzh5B2fX49ow@mail.gmail.com> (Juanma Barranquero's message of "Mon, 4 Apr 2011 18:04:34 +0200")

>> Check the `dolist' macro, it has a FIXME for that.
> OK, fair enough. Sorry for the noise.
> Is this one also documented (or has a logical explanation that I'm
> again missing)?

No, it's not documented tho it's the same underlying problem:

> ;; test.el  -*- lexical-binding: t -*-
> (condition-case test
>     (ignore)
>   (quit test)
>   (error test))
> ;; end

> No error. Now, if you remove `test' in either handler:

Right.  Internally, the condition-case above is turned into

  (condition-case :fun-body
      (lambda () (ignore))
    (quit (lambda (test) test))
    (error (lambda (test) test)))

I.e. the underlying problem (shared with dolist and some pcase
situations as well) is that one binding occurrence of a variable (above,
`test') is turned into 2 or more, so you can get warnings about an
unused variable because some of the its binders aren't used, but since
it really corresponds to a single binder in the source code the
programmer can't really fix it, hence the warning is an annoyance.

I'm not sure yet how best to solve the issue.  The main problem is
that this warning is important to help convert programs from dynamic to
lexical scoping, so it's an important tool and hence shouldn't be silenced
too lightheartedly.


        Stefan



  reply	other threads:[~2011-04-04 21:44 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-01 17:32 Lexical binding Stefan Monnier
2011-04-01 19:12 ` David De La Harpe Golden
2011-04-01 19:46 ` Eli Zaretskii
2011-04-04 16:05   ` Stefan Monnier
2011-04-01 20:04 ` Daniel Colascione
2011-04-01 20:39 ` cedet-bzr build failure (was : Lexical binding) Darren Hoo
2011-04-01 21:21   ` David Engster
2011-04-01 22:26     ` Darren Hoo
2011-04-02 12:40       ` David Engster
2011-04-02 13:42         ` Eric M. Ludlam
2011-04-02 18:22           ` cedet-bzr build failure David Engster
2011-04-02 18:29         ` cedet-bzr build failure (was : Lexical binding) Darren Hoo
2011-04-01 20:42 ` Lexical binding Eli Zaretskii
2011-04-01 22:13   ` Juanma Barranquero
2011-04-02  2:33 ` Juanma Barranquero
2011-04-02  3:36   ` Juanma Barranquero
2011-04-02 18:38     ` Stefan Monnier
2011-04-04 16:04       ` Juanma Barranquero
2011-04-04 21:44         ` Stefan Monnier [this message]
2011-04-04 21:56           ` Juanma Barranquero
2011-04-04 22:03           ` David Kastrup
2011-04-04 22:34             ` Stefan Monnier
2011-04-02 18:38   ` Stefan Monnier
2011-04-02 18:50     ` Juanma Barranquero
2011-04-02 18:57       ` Juanma Barranquero
2011-04-03 12:05         ` Christian Ohler
2011-04-03 12:26           ` Juanma Barranquero
2011-04-03 23:32             ` Christian Ohler
2011-04-04  0:12               ` Juanma Barranquero
2011-04-04 16:22               ` Stefan Monnier

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=jwv7hb91yud.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=lekktu@gmail.com \
    /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 public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).