DMD 1.038 and 2.022 releases

mastrost titi.mastro at free.fr
Thu Dec 18 12:25:15 PST 2008


Simen Kjaeraas Wrote:

> On Thu, 18 Dec 2008 13:27:16 +0100, Christopher Wright  
> <dhasenan at gmail.com> wrote:
> 
> > Simen Kjaeraas wrote:
> >> On Thu, 18 Dec 2008 07:01:49 +0100, Steven Schveighoffer  
> >> <schveiguy at yahoo.com> wrote:
> >>
> >>> Walter wants pure functions that have no side effects *AND* cannot be
> >>> affected by other functions' side effects.  Your example fails the  
> >>> second
> >>> requirement.
> >>  I should have put that in there as well. My point was that a delegate
> >> /can be/ as pure as a normal function.
> >
> > Right, but the compiler might have to take it on faith that the delegate  
> > is really pure.
> 
> Which is why I said a cast might be necessary.
> 
> -- 
> Simen

In fact I thought that a returned delegate with no side effect was inherently pure, because I thought the delegate was the only one to have access to its closure variables. In fact, as Simen showed, the closure can be shared between several delegates.

So if all delegates sharing the same closure have no side effect, can we say that they are all pure ?





More information about the Digitalmars-d-announce mailing list