> But then... what trick does GHC use to prevent CAF leaks? No tricks really, the garbage collector traces references from code as well as references from the heap to find all the live data. Of course, it doesn't actually examine the code; each code segment comes with a list of top-level closures that it references, called an SRT (static reference table).
In a standalone program, we know that only CAFs which are referenced by code which is reachable from the current machine state (i.e. the stack) will ever be used again. In an interpreted system it is more difficult: we don't know what expressions will be typed at the prompt in the future. Cheers, Simon _______________________________________________ Haskell mailing list [EMAIL PROTECTED] http://www.haskell.org/mailman/listinfo/haskell