dmd 2.029 release

Steven Schveighoffer schveiguy at yahoo.com
Thu Apr 23 06:31:49 PDT 2009


On Thu, 23 Apr 2009 09:24:59 -0400, Andrei Alexandrescu  
<SeeWebsiteForEmail at erdani.org> wrote:

> Steven Schveighoffer wrote:
>> This has to go into object.d and be part of the runtime, where  
>> std.range doesn't exist.  There is nothing stopping you from calling:
>>  streamOut(&outputrange.put);
>>  So I'd rather have a sink function.
>
> It must be a sink _object_ so it can hold its own state. And it must  
> support put() so it integrates with statically-bound output ranges.
>
> interface OutRange
> {
>      void put(... a number of overloads ...);
> }

I see now, yes I agree (I think that was don's original request anyways).   
That interface has to go in the runtime, though.

We may not be able to do this using templates... it has to be a virtual  
function in Object to be on-par with toString.  This means struct  
interfaces are a requirement if you want to use ranges :(

-Steve


More information about the Digitalmars-d-announce mailing list