[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: master 8f0f851: * lisp/autoarg.el: Use lexical binding.
From: |
Drew Adams |
Subject: |
RE: master 8f0f851: * lisp/autoarg.el: Use lexical binding. |
Date: |
Mon, 20 Apr 2020 07:55:27 -0700 (PDT) |
> > 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)))
>
> 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?
- Re: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Juanma Barranquero, 2020/04/19
- Re: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Stefan Kangas, 2020/04/20
- Re: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Michael Heerdegen, 2020/04/20
- Re: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Stefan Monnier, 2020/04/20
- RE: master 8f0f851: * lisp/autoarg.el: Use lexical binding.,
Drew Adams <=
- Re: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Stefan Monnier, 2020/04/20
- Re: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Michael Heerdegen, 2020/04/27
- Strange compiler warning in `dotimes' (was: master 8f0f851: * lisp/autoarg.el: Use lexical binding.), Michael Heerdegen, 2020/04/27
- RE: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Drew Adams, 2020/04/28
- Re: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Michael Heerdegen, 2020/04/28
- RE: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Drew Adams, 2020/04/28
- Re: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Michael Heerdegen, 2020/04/28
- RE: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Drew Adams, 2020/04/28
- Re: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Vladimir Sedach, 2020/04/28
- Re: master 8f0f851: * lisp/autoarg.el: Use lexical binding., Michael Heerdegen, 2020/04/29