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

Add stdlib functions from anselme v1

This commit is contained in:
Étienne Fildadut 2024-01-04 20:22:18 +01:00
parent 581c60048d
commit dac5b74fa6
30 changed files with 272 additions and 14 deletions

1
test/tests/error.ans Normal file
View file

@ -0,0 +1 @@
error("nope")

View file

@ -0,0 +1,9 @@
:x = pi
|{floor(x)}
|{ceil(x)}
|{round(x)}
|{round(x, 0.001)}

5
test/tests/list find.ans Normal file
View file

@ -0,0 +1,5 @@
:l = [5,4,2,1]
|{l!find(2)}
|{(*l)!find(2)}

View file

@ -0,0 +1,11 @@
:l = *[1,2,3]
|{l}
l!insert(4)
|{l}
l!insert(2, 5)
|{l}

5
test/tests/list len.ans Normal file
View file

@ -0,0 +1,5 @@
:l = [5,4,2,1]
|{l!len}
|{(*l)!len}

View file

@ -0,0 +1,11 @@
:l = *[1,2,3,4,5]
|{l}
l!remove()
|{l}
l!remove(2)
|{l}

View file

@ -0,0 +1,5 @@
:a = "foo":"barr"
|{a!name}
|{a!value}

View file

@ -0,0 +1,3 @@
:x = "hÉllo"
|{x!len}

View file

@ -0,0 +1,5 @@
:a = ("a":"b" # | hello)
:b = ("b":"c" # | world and { "x":"y" # |friends })
a+b