Tricky semantics of ranges & potentially numerous Phobos bugs

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Wed Oct 17 08:17:08 PDT 2012


On 10/16/12 1:59 AM, Jonathan M Davis wrote:
> On Monday, October 15, 2012 22:48:15 Jonathan M Davis wrote:
>> So, I don't really know what the right answer is, but I _really_ don't like
>> the idea of having to worry about the result of front changing after a call
>> to popFront in every single function that ever uses front. In the general
>> case, I just don't see how that's tenable. I'd _much_ rather that it be up
>> to the programmer using abnormal ranges such as ByLine to use them
>> correctly.
>
> And actually, it seems to me that issues like this make it look like it was a
> mistake to make ranges like ByLine ranges in the first place. They should have
> just defined opApply so that they'd work nicely in foreach but not with range-
> based functions. They're clearly not going to work with a _lot_ of range-based
> functions.

I think integration of pure streams within ranges is important and 
beneficial.

Andrei




More information about the Digitalmars-d mailing list