RFC on range design for D2

Jarrett Billingsley jarrett.billingsley at gmail.com
Mon Sep 8 17:56:35 PDT 2008


On Mon, Sep 8, 2008 at 8:24 PM, Andrei Alexandrescu
<SeeWebsiteForEmail at erdani.org> wrote:
> Sergey Gromov wrote:
>>
>> Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:
>>>
>>> Walter, Bartosz and myself have been hard at work trying to find the
>>> right abstraction for iteration. That abstraction would replace the infamous
>>> opApply and would allow for external iteration, thus paving the way to
>>> implementing real generic algorithms.
>>
>> opApply() wasn't my hero either. :)  Your article really looks like
>> something I'd expect to find in D.  It only requires foreach support, and
>> yeah, return by reference.
>
> Indeed. Both are in the works.

Quick question about this one -- how will iterators get foreach
support?  Are they classes or structs?  If they're structs, how will
the compiler know something is an iterator?  Or will it be based on
duck typing (if it looks like an iterator, it must be an iterator)?

And if this support involves "blessing" certain types within the
runtime, what will this mean for other runtime libraries?


More information about the Digitalmars-d-announce mailing list