[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to avoid compiler warning `unused lexical variable' for `dolist'
From: |
Stefan Monnier |
Subject: |
Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'? |
Date: |
Thu, 07 Jan 2021 23:40:11 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
> FWIW, Common Lisp has several iteration constructs that let you specify an
> optional return value up front (as you would say, in a sub-sub-expression).
> Not just `dolist' and `dotimes'. `do', for instance.
There are a few other such cases, indeed. I think most of them are like
`do` in the sense that they're *very* rarely used in ELisp (and
correspondingly most ELisp programmers have no idea what it does).
FWIW, I remember that I used to like `do*` back when I was programming
in Common Lisp, but nowadays I find it rather inscrutable.
In that category I think Scheme's named let is infinitely superior: both
more general and easier to understand. Too bad that it's kind of a pain
to implement efficiently in ELisp, but Vincent's `recur-let` gives
a pretty good approximation (still more general and easier to understand
than `do*`).
(c.f. https://github.com/VincentToups/recur).
> There's nothing particularly odd, new, or unlispy about such design.
> It's very old in Lisp iteration.
Old doesn't mean good.
Stefan
- Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?, (continued)
- Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?, Jean Louis, 2021/01/09
- Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?, Leo Butler, 2021/01/09
- Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?, Philipp Stephani, 2021/01/09
- Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?, Leo Butler, 2021/01/09
- Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?, Stefan Monnier, 2021/01/09
- Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?, Leo Butler, 2021/01/11
- Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?, Stefan Monnier, 2021/01/11
- RE: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?, Drew Adams, 2021/01/07
- Re: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?,
Stefan Monnier <=
- RE: How to avoid compiler warning `unused lexical variable' for `dolist' or `dotimes'?, Drew Adams, 2021/01/08
- How to get plist properties list?, Jean Louis, 2021/01/07
- Re: How to get plist properties list?, Stefan Monnier, 2021/01/08
- Re: How to get plist properties list?, Jean Louis, 2021/01/08
- Re: How to get plist properties list?, Stefan Monnier, 2021/01/08
- Re: How to get plist properties list?, Jean Louis, 2021/01/09
- Re: How to get plist properties list?, tomas, 2021/01/09
- Re: How to get plist properties list?, Jean Louis, 2021/01/10
- Re: How to get plist properties list?, Stefan Monnier, 2021/01/09
- Re: How to get plist properties list?, Jean Louis, 2021/01/12