To help LDC/GDC

Walter Bright newshound2 at digitalmars.com
Mon Apr 8 21:39:28 PDT 2013


On 4/8/2013 5:37 AM, Manu wrote:
>     Only builtins are pure in the sense of 'C'.  Even functions considered
>     PUREstrong by the frontend may update an internal state, so the rules just
>     don't apply.  Except for maybe global functions...   In any case, the only
>     benefit you can reap from 'D pure' functions are that they are more likely
>     to be const-folded / inlined.
>
> Oh my god... ..... this is the most upsetting thing I've heard all day! :(
> No really, I have been SOOOO excited for so long about this optimisation
> potential in D!
> There's gotta be something that can be done! >_<

I believe Iain is incorrect. Pure functions cannot squirrel away any persistent 
state.


More information about the Digitalmars-d mailing list