loom
17 строк · 355.0 Байт
1import "/test/source/simodo-script/import/asynch.simodo-script"
2: async
3
4def auto : factor = fn [factor] (int : x) -> int
5{
6if (x <= 1)
7return 1
8
9return x*factor(x-1)
10}
11
12//auto : f = asynch.future(factor, 10)
13def auto : f = async.future( fn [factor] () { return factor(10) } )
14def int : i = factor(10)
15
16print i
17print i == f.get()
18