Re: Gee Functional iterators
- From: Didier 'Ptitjes' <ptitjes free fr>
- To: Martin DeMello <martindemello gmail com>
- Cc: libgee-list gnome org
- Subject: Re: Gee Functional iterators
- Date: Tue, 13 Jul 2010 20:28:32 +0200
On 13/07/10 19:18, Martin DeMello wrote:
> One other thing - what about indexed iterators? Perhaps a method
>
> Iterator<Pair<int, G>> indexed(Iterator <G>) that converts, say, map
> into map-with-index. (Even better if vala gets support for multivalued
> iterators, though that seems like quite a huge change :))
There is already language support for tupples in Dova profile and there
is great chance it comes one day to the GLib profile. So an iterator
could return a Tupple, and you could do:
foreach (var (i, e) in iterator.indexed()) {
// do whatever with i and e
}
Regards, Didier.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]