Pure memoization, and more
bearophileHUGS at lycos.com
Thu May 3 08:50:35 PDT 2012
Threads like "Why D const is annoying" show that there is desire
for logical immutability, for pure memoization, etc. I'd like the
memoization of a pure function to be pure still.
This is a closely related group of problems (including "pointer
equality, external pointers, finalizers, and weak pointers")
surely present in functional languages too, so (with a bit of
help from a person of the "Lambda The Ultimate" blog) I have
found two papers that show some ideas and solutions.
"Stretching the storage manager: weak pointers and stable names
in Haskell" (1999), by Simon Peyton Jones, Simon Marlow, and
"Observable sharing for functional circuit description" (1999),
by Koen Claessen, David Sands (this looks less related, but the
authors face the same class of problems):
Probably there are other papers on this topic, with solutions
that don't require breaking purity or immutability in user code.
More information about the Digitalmars-d