ReverseIterable interface
# Kevin Smith (10 years ago)
Cool, and very thorough! I'll repost if I can think of any questions.
Cool, and very thorough! I'll repost if I can think of any questions. On Thu, Feb 19, 2015 at 6:16 PM, Lee Byron <leebyron at fb.com> wrote: > Hello all, > > I’m working on a spec proposal that I’d like to present as a strawman > (stage 0) for reverse iteration. > > https://github.com/leebyron/ecmascript-reverse-iterator > > The TL;DR is adding a new well known symbol `Symbol.reverseIterator` and > adding methods to the collection prototypes that can be efficiently > iterated in reverse. It also suggests adding `reverse()` to > %IteratorPrototype% as an API sugar. > > I’m looking for broad feedback as well as stakeholders if this > functionality is important to you. > > Thanks > > Lee Byron > > _______________________________________________ > es-discuss mailing list > es-discuss at mozilla.org > https://mail.mozilla.org/listinfo/es-discuss > > -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20150219/5e3b2fb3/attachment.html>
# Tab Atkins Jr. (10 years ago)
I like it! Formalizing the idea of a reversible iterator, so we don't always have to collect into a list and reverse that, is a great idea.
On Thu, Feb 19, 2015 at 3:16 PM, Lee Byron <leebyron at fb.com> wrote: > Hello all, > > I’m working on a spec proposal that I’d like to present as a strawman (stage > 0) for reverse iteration. > > https://github.com/leebyron/ecmascript-reverse-iterator > > The TL;DR is adding a new well known symbol `Symbol.reverseIterator` and > adding methods to the collection prototypes that can be efficiently iterated > in reverse. It also suggests adding `reverse()` to %IteratorPrototype% as an > API sugar. > > I’m looking for broad feedback as well as stakeholders if this functionality > is important to you. I like it! Formalizing the idea of a reversible iterator, so we don't always have to collect into a list and reverse that, is a great idea. ~TJ
I’m working on a spec proposal that I’d like to present as a strawman (stage 0) for reverse iteration.
leebyron/ecmascript-reverse-iterator
The TL;DR is adding a new well known symbol
Symbol.reverseIterator
and adding methods to the collection prototypes that can be efficiently iterated in reverse. It also suggests addingreverse()
to %IteratorPrototype% as an API sugar.I’m looking for broad feedback as well as stakeholders if this functionality is important to you.