Closures in Ground

This commit is contained in:
2026-03-02 10:09:10 +11:00
parent d011d2beb4
commit 5577679ded
7 changed files with 152 additions and 62 deletions

27
tests/closure.grnd Normal file
View File

@@ -0,0 +1,27 @@
set &x 5
PAUSE
fun !dingle -function -int &a
PAUSE
fun !capture -int -int &b
PAUSE
add $a $b &tmp
add $tmp $x &tmp
return $tmp
endfun
return $capture
endfun
call !dingle 3 &result
PAUSE
call !result 5 &y
println $y