It seems pure ain't so pure after all
deadalnix
deadalnix at gmail.com
Mon Oct 1 05:31:03 PDT 2012
Le 01/10/2012 08:07, Jonathan M Davis a écrit :
> On Monday, October 01, 2012 07:58:39 Tommi wrote:
>> On Monday, 1 October 2012 at 05:43:39 UTC, Alex Rønne Petersen
>>
>> wrote:
>>> As far as purity goes, pow2 *is* pure. ...
>>
>> According to http://en.wikipedia.org/wiki/Pure_function it's not:
>>
>> "The [pure] function always evaluates the same result value given
>> the same argument value(s)"
>
> Forget what Wikipedia says about pure. If you focus on that, you're going to
> be complaining about D's pure left and right, because what it's talking about
> and what D does are related but very different. D takes a very practical
> approach to functional purity. You should read this:
>
> http://stackoverflow.com/questions/8572399
>
> - Jonathan M Davis
Or that : http://klickverbot.at/blog/2012/05/purity-in-d/
More information about the Digitalmars-d
mailing list