Hi all,
I have the following small program using coroutines:
cnt := Object clone
cnt N := 0
cnt inc := method("incing!" println; N = N + 1)
cnt read := method("reading!" println; N)
incrementor := Object clone
incrementor run := method("running!" println; cnt @inc; yield)
"all created" println
r1 := cnt @read
incrementor @run
yield
r2 := cnt @read
yield
incrementor clone @run
yield
r3 := cnt @read
"at the end" println
r1 println
r2 println
r3 println
"really at the end" println
Strangely, I get the following output (consistently):
all created
running!
reading!
incing!
running!
reading!
at the end
0
1
incing!
reading!
2
really at the end
really at the end
So the question is: How is it possible that "really at the end" is output
twice?
I'm running Io on Linux btw...
Thanks in advance,
Hans
--
Dr. Hans Schippers
Doctor-Assistant
Formal Techniques in Software Engineering (FoTS)
University of Antwerp
Middelheimlaan 1
2020 Antwerpen - Belgium
Phone: +32 3 265 37 88
Fax: +32 3 265 37 77
http://www.win.ua.ac.be/~hschipp/A liberal is a person whose interests aren't at stake at the moment
-- Willis Player