[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Generators (iterators) for Gnu Emacs
From: |
Stefan Monnier |
Subject: |
Re: Generators (iterators) for Gnu Emacs |
Date: |
Fri, 05 Dec 2014 23:09:07 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) |
> Assuming both packages are suitable for inclusion into core, we can
> definitely make them work together.
That's the idea, yes.
> I'd still very much like to use nonlocal control flow instead of
> a sentinel for enumeration termination, however.
I'll let you guys decide together. I stated my preference, but I have
better things to worry about.
> That aside, I'm not sure I agree with your namespace preferences. `yield' is
> fundamentally a lexically-scoped macro.
The lexically scoped `yield' is OK. But the global (defmacro yield ...)
is not (tho, I'm OK with keeping it if wrapped in (unless (fboundp
'yield) ...)).
> I'd also strongly prefer using `next' as the iter-get function.
I know, but this one is out of the question. All globally-visible names
need to be namespace-clean. So it can be `gen-next'.
> I'd also prefer using `iterating' as the cl-loop keyword.
I know, but being globally visible, this is also out of the question: it
requires something with a "gen-" or at least some "generator" in its
name somewhere.
> Because the keyword is only active in the lexical scope of a cl-loop
> construct, there's an even lower risk of collision, and the word
> "iterating" is exactly the right thing in the cl-loop language:
> (cl-loop for x iterating y collect x) reads very well.
But it doesn't say we're iterating on your particular kind of iteratable
construct.
[ BTW: regardless of namespace cleanliness, I don't find "iterating"
above to be a good choice, because "x" doesn't "iterate y".
The "cl-loop" doesn't do anything else than iterate, so "iterating" is
almost necessarily a misnomer in there. From an English language
point of view, I'd expect something more like "for x generated-by y"
or "for x in-generator y" or "for x in y". ]
Stefan
- Re: Generators (iterators) for Gnu Emacs, (continued)
Re: Generators (iterators) for Gnu Emacs, Thierry Volpiatto, 2014/12/05
- Re: Generators (iterators) for Gnu Emacs, Stefan Monnier, 2014/12/05
- Re: Generators (iterators) for Gnu Emacs, Michael Heerdegen, 2014/12/05
- Re: Generators (iterators) for Gnu Emacs, Stefan Monnier, 2014/12/05
- Re: Generators (iterators) for Gnu Emacs, Daniel Colascione, 2014/12/05
- Re: Generators (iterators) for Gnu Emacs, Michael Heerdegen, 2014/12/05
- Re: Generators (iterators) for Gnu Emacs, Michael Heerdegen, 2014/12/05
- Re: Generators (iterators) for Gnu Emacs,
Stefan Monnier <=
- Re: Generators (iterators) for Gnu Emacs, Daniel Colascione, 2014/12/06
- Re: Generators (iterators) for Gnu Emacs, Stefan Monnier, 2014/12/06
- Re: Generators (iterators) for Gnu Emacs, Daniel Colascione, 2014/12/06
- Re: Generators (iterators) for Gnu Emacs, Stefan Monnier, 2014/12/07
- Re: Generators (iterators) for Gnu Emacs, Daniel Colascione, 2014/12/07
- Re: Generators (iterators) for Gnu Emacs, Ted Zlatanov, 2014/12/07
- Namespace macros (was: Generators (iterators) for Gnu Emacs), Helmut Eller, 2014/12/07
- Re: Namespace macros (was: Generators (iterators) for Gnu Emacs), Artur Malabarba, 2014/12/07
- Re: Namespace macros, Helmut Eller, 2014/12/08
- Re: Namespace macros, Artur Malabarba, 2014/12/08