[erlang-questions] effect of destructive updates on GC implementation

Mihai Balea mihai@REDACTED
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)
> behavior.

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?

Mihai

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2411 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20080129/d78689b3/attachment.bin>


More information about the erlang-questions mailing list