mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-06 14:58:50 +00:00
23 lines
219 B
Text
23 lines
219 B
Text
|
|
fun f () {
|
||
|
|
local x, l = {};
|
||
|
|
fun g () { x}
|
||
|
|
|
||
|
|
x := 1;
|
||
|
|
l := g : l;
|
||
|
|
|
||
|
|
x := 2;
|
||
|
|
l := g : l;
|
||
|
|
|
||
|
|
l
|
||
|
|
}
|
||
|
|
|
||
|
|
fun p (l) {
|
||
|
|
case l of
|
||
|
|
{} -> skip
|
||
|
|
| h : tl -> write (h ()); p (tl)
|
||
|
|
esac
|
||
|
|
}
|
||
|
|
|
||
|
|
local x = read ();
|
||
|
|
|
||
|
|
p (f ())
|