I'm playing with Futures in Io. I have some methods that do some work:
a := method(10 + 20)
b := method(20 + 30)
c := method(30 + 40)
And I want to run them concurrently. This works as expected:
m := method(list(@a, @b, @c))
f := @m
writeln((f join(" + ")) .. " = " .. f sum)
However, moving the work of creating the string into method m
does not work:
m := method(
s := list(@a, @b, @c)
((s join(" + ")) .. " = " .. (s sum))
)
f := @m
writeln(f)
This raises Scheduler: nothing left to resume so we are exiting
.
Why? What have I not understood?