Mitigating the attribute proliferation - attribute inference for functions

Martin Nowak via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 17 10:25:03 PDT 2015


On Friday, 17 July 2015 at 14:32:35 UTC, Kagamin wrote:
> You don't always have the source for the function, and 
> currently purity needs only the function signature alone. Also 
> a function attribute allows to enforce purity.

If you don't have the source, e.g. it's in a foreign library, 
then the function is likely heavyweight and you'll cache it 
yourself.
You wouldn't call fib(30) or sin(x) anytime you need it and rely 
on the compiler to figure out the refusing.


More information about the Digitalmars-d mailing list