mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-28 09:09:31 +00:00
Add anonymous functions
This commit is contained in:
parent
2c6d66c222
commit
5e441886c0
15 changed files with 352 additions and 110 deletions
21
test/tests/anonymous function.ans
Normal file
21
test/tests/anonymous function.ans
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
:f = $(x)x*x
|
||||
|
||||
:$g(x)
|
||||
@x*x
|
||||
|
||||
{f(5)} = {g(5)}
|
||||
|
||||
{f(2)} = {g(2)}
|
||||
|
||||
:y = 5
|
||||
:h = $(x)x*x+y
|
||||
|
||||
{h(3)} == 14
|
||||
|
||||
~ y := 7
|
||||
|
||||
{h(5)} == 32
|
||||
|
||||
:i = $y*y
|
||||
|
||||
{i} == 49
|
||||
Loading…
Add table
Add a link
Reference in a new issue