Any chance to call Tango as Extended Standard Library
Andrei Alexandrescu
SeeWebsiteForEmail at erdani.org
Mon Jan 19 08:07:45 PST 2009
Daniel Keep wrote:
>
> Don wrote:
>> [snip]
>>
>> And in fact, a Tango2 floor plan would be a good idea, too. For example,
>> now that D2 supports foreach ranges, Tango containers will almost
>> certainly want to support them.
>
> For reference, from tango.util.collection.model.Iterator:
>
> public interface Iterator(V)
> {
> public bool more();
>
> public V get();
>
> int opApply (int delegate (inout V value) dg);
> }
>
> Basically, Tango's iterators use more (negation of empty,) and get
> (which is next and head combined.)
>
> This brings up a request I have for Andrei: please ensure there is an
> actual interface for ranges (preferably enforced.) Compile-time duck
> typing [1] is awesome, but sometimes you need run-time polymorphism.
There is a persistent misunderstanding about the two. They're not
competing. Duck typing as used in foreach and ranges does not preclude
definition and use of explicit interfaces and dynamic polymorphism.
Andrei
More information about the Digitalmars-d
mailing list