Pure higher order functions

Jonathan M Davis jmdavisProg at gmx.com
Thu Jul 7 15:34:59 PDT 2011


On 2011-07-07 15:19, bearophile wrote:
> KennyTM~:
> > On Jul 8, 11 00:43, KennyTM~ wrote:
> > > No, I think it's a bug in pure-inference.
> > > 
> > > pure int h() {
> > > 
> > > return 1;
> > > 
> > > }
> > > int f(alias g)() {
> > > 
> > > return g();
> > > 
> > > }
> > > pure int i() {
> > > 
> > > return f!h(); // pure function 'i' cannot call impure function
> > > 'f'
> > > 
> > > }
> > 
> > http://d.puremagic.com/issues/show_bug.cgi?id=6265
> 
> I was probably wrong, as usual. Thank you for seeing the real problem and
> for the bug report :-) Maybe this is worth fixing before DMD 2.054 goes
> out of beta, I am not sure.

It certainly needs fixing, but I don't know how high a priority it's going to 
be to fix issues related to purity inference with 2.054 given that it's a new 
feature and so bugs related to it aren't likely to be regressions. If it 
doesn't get fixed for 2.054 though, it'll probably be fixed for 2.055. 
Regardless, the overall situation with purity is improving.

- Jonathan M Davis


More information about the Digitalmars-d mailing list