40 ms·
sum = 2*f(2) seems nicer than having sum= twice. If you were enforcing this with the compiler, you would also need something that would suppress the enforcing,
by oh_sigh 7y ago
sum = 2*f(2) seems nicer than having sum= twice.
If you were enforcing this with the compiler, you would also need something that would suppress the enforcing, because the millions of pre-existing functions would probably not get an updated attribute marking it as pure. And once you do that, the compiler can't really trust anything that function does, because it may actually be calling a non-pure function.