Update spec.md

This commit is contained in:
Fcalva 2025-03-03 10:29:04 +01:00
parent 7276ada96e
commit 142c01e443

19
spec.md
View file

@ -91,20 +91,6 @@ In this document :
- `(while <cond> [expressions])`:
while cond evalutates to true, will execute optional expressions
- `(for (<vec> <var>) [expressions])`
Will initialize a local scope variable var with the type of the vector vec,
and execute expressions for every element of vec. var will be set to the
element of vec interated on
Example:
```
(let:vec:int a (1,2,3))
(for (a i)
(write i)
(write " ")
)
```
will display `1 2 3 `
- `(fn (<name> [arg0[:type] ... argN[:type]]) [expressions])` :
Declares a function of name name, optional args arg0-argN with optional
types (recommended to explicit them), that executes optional expressions
@ -232,10 +218,9 @@ if 1:2 / 1:2:3, means stitching 1,2,3 together as a 2 or 3 byte value
- `popl` : pops the last #2 values on stack, starting from #1
- `cst0` : 2:3 -> LSW of 3
- `cst1` : 2:3 -> MSW of 3
- `iter` : Iterates on vector 1, keeping track with int value at 2, and sets
int value at 3 to 1 when done
to 1
- `not` : !1 -> stack
- `and` : 1 && 2 -> stack
- `or` : 1 || 2 -> stack
- `vpop` : removes element at pos 2 of vec 1 -> stack
- `vpsh` : pushes back 2 on vector 1