mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-15 11:18:43 +00:00
23 lines
No EOL
233 B
Text
23 lines
No EOL
233 B
Text
fun f () {
|
|
var x, l = Nil;
|
|
fun g () {x}
|
|
|
|
x := 1;
|
|
l := Cons (g, l);
|
|
|
|
x := 2;
|
|
l := Cons (g, l);
|
|
|
|
l
|
|
}
|
|
|
|
fun p (l) {
|
|
case l of
|
|
Nil -> skip
|
|
| Cons (h, tl) -> write (h ()); p (tl)
|
|
esac
|
|
}
|
|
|
|
val x = read ();
|
|
|
|
p (f ()) |