More range woes: composed ranges are unsafe to return from functions

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Oct 20 08:48:06 PDT 2012


On Sat, Oct 20, 2012 at 11:57:48AM +0300, Andrei Alexandrescu wrote:
> On 10/19/12 6:31 PM, H. S. Teoh wrote:
> >>The question here is whether this is just endless churn or real
> >>progress. I'm optimistic, but am curious about others' opinion.
> >
> >I'm not sure what you're referring to by "this". Are you talking
> >about cartesianProduct specifically, or something more general?
> 
> I was referring to your woes. (Sorry for my slow and scarce answers,
> I'm traveling.)
[...]

Yes you mentioned that.

Well, I think finding bugs in Phobos (or druntime/dmd) is always a good
thing, 'cos that's a first step towards fixing them. You can't fix
something you're unaware of, after all. But it isn't always a pleasant
experience. :)

Though I think some of the issues are fundamental and require somewhat
more invasive changes -- like the whole debate about what exactly should
be expected of .front in an input range. That discussion seems to have
fizzled out at a stalemate, but I think it's important to push through
and decide things one way or the other, because the current situation
lends itself to subtle bugs and is not acceptable if D is to be used
more widely. I rather suffer through invasive changes now, than to be
faced later with large amounts of code that are fundamentally broken yet
unfixable because by then it's too late to do anything about it.


T

-- 
Computers shouldn't beep through the keyhole.


More information about the Digitalmars-d mailing list