add aget and aput to array type

This commit is contained in:
Daniella / Tove 2022-07-26 23:34:31 +02:00
parent 2b66678e8f
commit 1724163446
3 changed files with 38 additions and 36 deletions

View file

@ -647,12 +647,6 @@
-
## >TYPE_SHADOW
-
### Methods
## >TYPE_INT
-
@ -669,36 +663,6 @@
-
## >TYPE_BYTE
-
### Methods
## >TYPE_FUNCTION
-
### Methods
## >TYPE_FLOAT
-
### Methods
## >TYPE_NULL
-
### Methods
## >TYPE_LONG
-
### Methods
## >TYPE_STRING
-
@ -740,11 +704,21 @@
-
#### `aput ::: -> `
-
#### `stackTraceToString ::: -> `
-
#### `aget ::: -> `
-
#### `construct ::: -> `
-
@ -783,11 +757,21 @@
-
#### `aput ::: -> `
-
#### `stackTraceToString ::: -> `
-
#### `aget ::: -> `
-
#### `construct ::: -> `
-

View file

@ -712,11 +712,21 @@ over type definitions, to string processing.
Iterates through this array and calls the callable with the object (NOT the index).
#### `aput ::: item idx -> `
Puts an item into the array
#### `stackTraceToString ::: -> string`
Converts this array to a stack trace string. Only use on compatible arrays!
#### `aget ::: idx -> item`
Gets an item from the array
#### `construct ::: length -> array`
Constructs an array with a length

View file

@ -150,6 +150,14 @@ def TYPE_ARRAY construct array {
} this foreach
s
}
aget {
with idx this ;
this idx aget
}
aput {
with item idx this ;
this idx item aput
}
} =TYPE_ARRAY
def Array TYPE_ARRAY =Array
def TYPE_STRING construct string array {