docs/system: document len
and index
This commit is contained in:
parent
e2f9538156
commit
628fafdc1b
|
@ -602,6 +602,29 @@ stroke 128 #00000004 (vec 0 0)
|
||||||
If you try to to use this brush to fill up a single spot with black, you will notice that despite all the math suggesting so, the color will end up gray instead.
|
If you try to to use this brush to fill up a single spot with black, you will notice that despite all the math suggesting so, the color will end up gray instead.
|
||||||
|
|
||||||
|
|
||||||
|
## Lists
|
||||||
|
|
||||||
|
```haku
|
||||||
|
len
|
||||||
|
l : list _
|
||||||
|
-> number
|
||||||
|
```
|
||||||
|
|
||||||
|
Returns the number of elements in the given list (its `len`gth.)
|
||||||
|
|
||||||
|
```haku
|
||||||
|
index
|
||||||
|
l : list t
|
||||||
|
i : number
|
||||||
|
-> t
|
||||||
|
```
|
||||||
|
|
||||||
|
Returns an element of the list, located at the given index `i`.
|
||||||
|
The first element is located at index 0.
|
||||||
|
|
||||||
|
Indexing out of bounds is an error.
|
||||||
|
|
||||||
|
|
||||||
## Shapes
|
## Shapes
|
||||||
|
|
||||||
```haku
|
```haku
|
||||||
|
|
Loading…
Reference in a new issue