To what extent does the system cache / reuse immutable instances?

For example, I have a zero(...) function that returns zero for a particular 
(immutable) numeric type.  Do I need to cache that myself, or will the 
system somehow intern values and re-use the same instance?

Bonus question - is there a macro(?) that can be applied to a function and 
which automatically adds LRU caching of the result by argument with weak 
references?

Thanks,
Andrew

Reply via email to