[erlang-questions] effect of destructive updates on GC implementation
Wed Jan 30 00:14:57 CET 2008
On Jan 29, 2008, at 5:11 PM, Jonathan Amsterdam wrote:
> How about promises with memoization? That is, a no-argument fun whose
> result is cached the first time it is called. This would let you
> implement lazy lists, and get the performance bounds of the Okasaki
> data structures. E.g. queues with worst-case (not amortized) O(1)
That wouldn't work with funs that have side effects, such as I/O.
Maybe the compiler/VM would be able to recognize a fun that has side
effects and avoid this optimization...
Or maybe I'm missing something?
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2411 bytes
Desc: not available
More information about the erlang-questions