mirror of
https://github.com/ProgramSnail/Lama.git
synced 2025-12-24 07:38:46 +00:00
FSF in SM (only obe-level closure yet)
This commit is contained in:
parent
89e0d04f3d
commit
4fec2aa29e
8 changed files with 160 additions and 53 deletions
21
regression/test065.expr
Normal file
21
regression/test065.expr
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
fun f () {
|
||||
local x, l = {};
|
||||
fun g () {return x}
|
||||
|
||||
x := 1;
|
||||
l := g : l;
|
||||
|
||||
x := 2;
|
||||
l := g : l;
|
||||
|
||||
return l
|
||||
}
|
||||
|
||||
fun p (l) {
|
||||
case l of
|
||||
{} -> skip
|
||||
| h : tl -> write (h ()); p (tl)
|
||||
esac
|
||||
}
|
||||
|
||||
p (f ())
|
||||
Loading…
Add table
Add a link
Reference in a new issue