It seems pure ain't so pure after all

Brad Roberts braddr at puremagic.com
Sun Sep 30 23:13:58 PDT 2012


On 9/30/2012 11:09 PM, Tommi wrote:
> On Monday, 1 October 2012 at 06:01:24 UTC, Jonathan M Davis wrote:
>>
>> It would be kind of like complaining that a pure function returns different
>> values on Linux and Windows due to a version statement or static if. It's just
>> that in the thing that varies is compile time vs runtime not the target
>> machine. e.g.
> 
> 
> Actually... let's not even worry about the definition of the word 'pure'. Let's just ask ourselves: do we really want to
> live in a world where people can write code like that:
> 
> void main()
> {
>     auto x = pow2(3);
>     enum y = pow2(3);
> 
>     assert(x == y + 3);
> 
>     writeln("Take that mr. \"math\" professor!");
>     readln();
> }

So, Tommi, do you have a suggestion or proposal to make or are you just trying to point and snicker?  There's a
multitude of ways that bad programmers can write bad code.


More information about the Digitalmars-d mailing list