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
+24
View File
@@ -0,0 +1,24 @@
// retoor <retoor@molodetz.nl>
import "scheduler" for Scheduler, Future
var isPositive = async { |x| x > 0 }
var getValue = async { |x| x }
if (await isPositive(5)) {
System.print("positive") // expect: positive
}
if (await isPositive(-5)) {
System.print("unreachable")
} else {
System.print("negative") // expect: negative
}
var result = await isPositive(10) ? "yes" : "no"
System.print(result) // expect: yes
while (await getValue(false)) {
System.print("unreachable")
}
System.print("after while") // expect: after while