http://d.puremagic.com/issues/show_bug.cgi?id=3356



--- Comment #6 from Don <clugd...@yahoo.com.au> 2009-10-05 04:57:26 PDT ---
(In reply to comment #5)
> Well, I must agree, your scheme works if programmer bothered to mark shared
> data properly.

It's still guaranteed that pure functions cannot read or write 'shared' or
'__gshared' data members. So we know that it cannot be affected by other
threads, so we only have to worry about other things which happen in that same
expression.

Note that you can just look at the parameter list and distinguish levels of
purity: if there are any non-immutable reference parameters, it's not cachable.
I guess the question is whether that additional complexity is justified.

BTW, in the latest DMD, toLower(), toUpper() now take const(char)[] parameters,
instead of immutable. Under your scheme, they could not be marked as pure.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to