Is this function pure?

Bruno Medeiros brunodomedeiros+spam at com.gmail
Tue Sep 18 16:17:10 PDT 2007


Janice Caron wrote:
> On 9/18/07, OF <nospam at nospammington.com> wrote:
>> Problems arise as long as you allow new to fail like this or if you use the address you get (which of course is not deterministic to the degree we want).
> 
> I think the "address of" operator would have to banned completely from
> pure functions, otherwise you could do
> 

Can you give another example? The one you gave:

> int definitelyNotPure()
> {
>     int x;
>     return cast(int)&x;
> }
> 
> 

is invalid even for non-pure functions.

-- 
Bruno Medeiros - MSc in CS/E student
http://www.prowiki.org/wiki4d/wiki.cgi?BrunoMedeiros#D



More information about the Digitalmars-d mailing list