D 2015/2016 Vision?

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue Oct 6 22:13:07 PDT 2015


On 10/6/2015 7:57 PM, bitwise wrote:
>> What can a stream do that a range cannot?
>
> I was trying to make my case for polymorphism, so I haven't thought much about
> streams specifically, but one obvious thing that stands out is growing on demand.
>
> Stream s = new Stream(4);
> s.write(1);
> s.write(2); // underlaying buffer grows automatically
>
> I don't see how you would do something like this with a range.

It's what an OutputRange does.


> Again though, if I have to restate what I've been arguing for as simply as
> possible, it's that I want to use RAII and polymorphism at the same time, as a
> natural language solution. DIP74 would satisfy everything I'm asking for.

Yes. We need to do that.



More information about the Digitalmars-d mailing list