[phobos] [D-Programming-Language/phobos] 4f28db: not really pure
Jonathan M Davis
jmdavisProg at gmx.com
Sat Jun 25 22:47:49 PDT 2011
On 2011-06-25 20:31, Walter Bright wrote:
> On 6/25/2011 8:25 PM, Jonathan M Davis wrote:
> > On 2011-06-25 20:23, Walter Bright wrote:
> >> On 6/25/2011 8:01 PM, Jonathan M Davis wrote:
> >>> If they're not really pure, they shouldn't compile with pure.
> >>
> >> They won't in the upcoming checkin.
> >>
> >>> Also, not being
> >>>
> >>> able to use opAssign in pure functions could be rather annoying. Why
> >>> doesn't that work?
> >>
> >> Pure functions cannot mutate data through pointers passed to them.
> >
> > Weakly pure functions are supposed to be able to.
>
> The compiler wasn't checking this at all. It's possible we can loosen
> things up after we understand the issues better, but we should start with
> being very conservative about what purity means.
It's fine with me if we make pure more restrictive as we sort it all out, but
ultimately, if we can't make member functions at least weakly pure (as it
appears is now the case - or at least non-const member functions can't pure;
I'm not sure which it is without looking a lot closer at the changes that you
made), then that's going to be a pretty big blow to purity in general. We'll
still be better off than we were prior to weakly pure being introduced, but
it'll still be extremely restrictive.
- Jonathan M Davis
More information about the phobos
mailing list