Here's the shortest code I was able to construct to exercise the bug I
was seeing:
- --------------------
functor
import
Application
System
define
Dict
Stream
in
{WeakDictionary.new Stream Dict}
thread
{ForAll Stream
proc {$ A#B}
{System.showInfo "Stream."}
{System.show A}
{System.show B}
end
}
end
local Foo in
Foo = proc {$ M} {System.showInfo "Foo"#M} end
{WeakDictionary.put Dict 'Foo' Foo}
end
{System.gcDo}
{System.show {WeakDictionary.entries Dict}}
{System.showInfo "Delaying."}
{Delay 5000}
{Application.exit 0}
end
- -------------
Output:
- -------------
rlpowell@chain> ./temp
['Foo'#<P/1 Foo>]
Delaying.
rlpowell@chain>
- -------------
The ForAll procedure never gets called. At all. This is very strange, since
Foo is _clearly_ no longer accessible by the time gcDo is called.
What am I doing wrong?
-Robin
-- http://www.digitalkingdom.org/~rlpowell/ BTW, I'm male, honest. le datni cu djica le nu zifre .iku'i .oi le so'e datni cu to'e te pilno je xlali -- RLP http://www.lojban.org/ - Please send submissions to users@mozart-oz.org and administriva mail to users-request@mozart-oz.org. The Mozart Oz web site is at http://www.mozart-oz.org/.