|
I'm not even sure in what kind of nightmare land you'd want iterating over the same collection twice in a row to print two different results. IEnumerator is the iterator for IEnumerable. Iterators are mutable even when the enumerable isn't, which is why it makes no sense to expect any sort of consumer state to be encoded in the enumerable. foreach creates a new iterator (IEnumerator). If you want to use the same enumerator across multiple loops (i.e. for chunking), create it yourself before the loops and use the MoveNext method manually. edit: also for LINQ it wouldn't be that hard to write a collection wrapper that does chunking for you implementing IEnumerable. Volte fucked around with this message at 14:20 on Jun 22, 2014 |
# ¿ Jun 22, 2014 14:16 |
|
|
# ¿ May 2, 2024 02:00 |
|
Malcolm XML posted:The factory-ness of ienumerable is fine, it's just that it doesn't make a lot of sense to iterate over a factory. It's such an unusual situation to have to reuse an iterator over multiple loops that I don't see why just converting your foreach loops into regular for or while loops using explicit iterators is such a big deal. Also, C# code:
C# code:
|
# ¿ Jun 22, 2014 17:59 |
|
crashdome posted:Anyone use Xamarin? Client is looking to get a native framework supplied both for iOS and Android development into an app for both platforms and setting up two development environments for the same project seems cumbersome.
|
# ¿ Jul 30, 2014 02:39 |
|
crashdome posted:Good to hear. Think I could get away with the free IDE for a demo? I'm sure if the demo was successful, the $999/year would be a drop in the bucket for the planned product development.
|
# ¿ Jul 30, 2014 03:06 |
|
crashdome posted:I think that's possible. It looks amazing! Definately disappointed by the limitations of the free version but, the trial should be sufficient. I'll definitely make use of the 30 days for sure. Just realized it's $999 PER platform. Ugh.
|
# ¿ Jul 30, 2014 14:14 |