Any chance to call Tango as Extended Standard Library

Daniel Keep daniel.keep.lists at gmail.com
Mon Jan 19 07:34:14 PST 2009



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.

  -- Daniel

[1] There's a funny case of this falling to pieces in C#; they
introduced templates in C# 2.0, I believe.  However, to do anything
moderately useful, you had to use interfaces to tell the compiler what
was acceptable to pass.

Of course, you can't have operator overloads in interfaces, which meant
it's IMPOSSIBLE to do any form of arithmetic in templates in C#.  Whoops.



More information about the Digitalmars-d mailing list