emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: unused local variables


From: Juanma Barranquero
Subject: Re: unused local variables
Date: Fri, 30 Nov 2007 16:31:31 +0100

On Nov 30, 2007 4:10 PM, Stefan Monnier <address@hidden> wrote:

> Yes.  And that's good.

As I've said, I'm all for a lexically-scoped elisp. But I'm a bit
worried by introducing warnings for things that are not "wrong" (or,
at least, weren't until now).

> E.g. if you want to compile this file with the
> lexical-scoping version of Emacs that Miles has been working on, this
> is indispensable.

Any hope of that branch merged with the trunk sometime?

> BTW, in the above example, the byte-compiler already complains in the
> `test' function, so it's not like it's going to make that big
> a difference.

As shown in a previous message, there's no warning if the function
tests whether my-dynamic-variable is bound.

> Also dynamic scoping is sufficiently odd and rarely used that it deserve
> special mention in the code.  It's pretty common to mark it with
> a comment.  And code is always better than a comment since it tends to
> bitrot a bit less quickly.

I agree that code is better than a comment. I'm not sure I agree that
dynamic scoping is "odd and rarely used" in elisp packages.

> PS: Another "unused var" warning which we should add (I don't have it
>     in my lock hack yet, tho) is the one that notices when a `defvar'
>     declares a variable which is not used in the file.

That one seems useful, yes. byte-compiler-silencing `defvar's (and now
`define-function's), like `require's (and C #include's), tend to
accumulate even when they cease to be necessary.

             Juanma




reply via email to

[Prev in Thread] Current Thread [Next in Thread]