Stewart Gordon:

> But if the method is pure, the compiler can automatically implement this as 
> an optimisation.

Functions like toHash take nothing and return a single size_t (hash_t). Often 
you want to compute the hash value lazily, but this is not possible if toHash 
needs to be pure. A explicit optional @memoize annotation (similar to the 
std.functional.memoize) allows toHash to be both catching and safe. (I was also 
thinking about the idea of a @trusted_pure, but I don't like it, and I think it 
causes chaos).

Bye,
bearophile

Reply via email to