mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-16 19:58:46 +00:00
23 lines
233 B
Text
23 lines
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 ())
|