🐐 Unpacking arrays
This commit is contained in:
15
README.md
15
README.md
@@ -34,6 +34,21 @@ Variable can consist of lower-case letters, numbers, as well as `_`.
|
||||
|
||||
`x AVGE III` is equivalent to `DESIGNA x VT x + III`.
|
||||
|
||||
### Destructuring
|
||||
|
||||
Multiple variables can be assigned at once by unpacking an array or multi-return function:
|
||||
|
||||
```
|
||||
DEFINI pair (a, b) VT { REDI (a, b) }
|
||||
DESIGNA x, y VT INVOCA pair (III, VII)
|
||||
```
|
||||
|
||||
The number of targets must match the length of the array. This also works with array literals:
|
||||
|
||||
```
|
||||
DESIGNA a, b, c VT [I, II, III]
|
||||
```
|
||||
|
||||
## Data types
|
||||
### NVLLVS
|
||||
`NVLLVS` is a special kind of data type in `CENTVRION`, similar to the `null` value in many other languages. `NVLLVS` can be 0 if evaluated as an int or float, or an empty string if evaluated as a string. `NVLLVS` cannot be evaluated as a boolean.
|
||||
|
||||
Reference in New Issue
Block a user