Transitive const sucks
Bruce Adams
tortoise_74 at ya.thewho.co.uk
Wed Sep 12 05:57:57 PDT 2007
Janice Caron Wrote:
[snip]
> This just pulls the rug out from under:
> >
> > 1) functional programming
>
>
> Functional programming isn't possible anyway unless the function can also
> guarantee that it won't modify /global/ variables, and I see no way of
> specifying that in the prototype.
>
>
>
> 2) multithreaded programming
>
>
> Likewise, a function cannot be guaranteed to be completely threadsafe unless
> it guarantees not to modify global variables, and I see no way of specifying
> that in the prototype.
>
You obviously missed the discussion of the "pure" keyword, borrowed from Fortran-90 from the conference. This is a clear way of declaring that a function must not have any side-effects. Something I've long hoped to see in C++ too.
http://s3.amazonaws.com/dconf2007/WalterAndrei.pdf
Regards,
Bruce.
More information about the Digitalmars-d
mailing list