This commit is contained in:
2026-01-25 10:50:20 +01:00
parent e4a94d576b
commit 735596fdf6
48 changed files with 1543 additions and 86 deletions
+17
View File
@@ -0,0 +1,17 @@
// retoor <retoor@molodetz.nl>
import "scheduler" for Scheduler, Future
var double = async { |x| x * 2 }
var triple = async { |x| x * 3 }
System.print(await double(5)) // expect: 10
System.print(await double.call(5)) // expect: 10
var f1 = double.call(10)
var f2 = triple.call(10)
System.print(await f1) // expect: 20
System.print(await f2) // expect: 30
System.print(await double(await triple.call(2))) // expect: 12
System.print(await double.call(await triple(2))) // expect: 12