mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 09:09:31 +00:00
Second test batch and associated fixes
This commit is contained in:
parent
7abb116876
commit
9b7d1e436e
56 changed files with 760 additions and 27 deletions
40
test/tests/function scoped mutable.ans
Normal file
40
test/tests/function scoped mutable.ans
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
:n = 0
|
||||
|
||||
:$ f(c=1)
|
||||
:a = *[]
|
||||
|
||||
|start: {a}
|
||||
|
||||
a!insert(c)
|
||||
|
||||
n += 1
|
||||
|
||||
|before recursion {c}: {a}
|
||||
|
||||
n < 5 ~
|
||||
f(c+1)
|
||||
|
||||
|after recursion {c}: {a}
|
||||
|
||||
|new list each time:
|
||||
|
||||
f!
|
||||
|
||||
:$ g(c=1, a=*[])
|
||||
|start: {a}
|
||||
|
||||
a!insert(c)
|
||||
|
||||
n += 1
|
||||
|
||||
|before recursion {c}: {a}
|
||||
|
||||
n < 5 ~
|
||||
g(c+1, a)
|
||||
|
||||
|after recursion {c}: {a}
|
||||
|
||||
|pass list:
|
||||
|
||||
n = 0
|
||||
g!
|
||||
Loading…
Add table
Add a link
Reference in a new issue