1
0
Fork 0
mirror of https://github.com/Reuh/anselme.git synced 2025-10-28 09:09:31 +00:00

Add scoped functions

This commit is contained in:
Étienne Fildadut 2021-12-10 23:22:06 +01:00
parent 3d32f35d67
commit fef498b3d7
16 changed files with 1164 additions and 58 deletions

View 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