Lists package
This commit is contained in:
@@ -3,9 +3,10 @@ fun -string !ltos -list &inlist
|
|||||||
getlistsize *inlist &listlen
|
getlistsize *inlist &listlen
|
||||||
set &idx 0
|
set &idx 0
|
||||||
set &ans ""
|
set &ans ""
|
||||||
add $ans '[' &ans
|
add $ans "[" &ans
|
||||||
@stdoutloop
|
@stdoutloop
|
||||||
getlistat *inlist $idx &store
|
getlistat *inlist $idx &store
|
||||||
|
tostring $store &store
|
||||||
add $ans $store &ans
|
add $ans $store &ans
|
||||||
add $idx 1 &idx
|
add $idx 1 &idx
|
||||||
equal $idx $listlen &store
|
equal $idx $listlen &store
|
||||||
@@ -17,8 +18,3 @@ fun -string !ltos -list &inlist
|
|||||||
add $ans "]" &ans
|
add $ans "]" &ans
|
||||||
return $ans
|
return $ans
|
||||||
endfun
|
endfun
|
||||||
|
|
||||||
setlist *store 4 2 "Hello"
|
|
||||||
pusharg *store
|
|
||||||
call !ltos &store
|
|
||||||
stdlnout $store
|
|
||||||
@@ -1 +1,11 @@
|
|||||||
### Due to the current limitations of ground, this package is not ready for use.
|
# Lists library
|
||||||
|
|
||||||
|
This library adds extra list manipulation functions to ground. It is entirely coded in ground.
|
||||||
|
|
||||||
|
Please note that you cannot copy a single function from the package, as some functions rely on other functions in the library (reliance on other functions is detailed below).
|
||||||
|
|
||||||
|
## Functions
|
||||||
|
|
||||||
|
### fun -string !ltos -list &inlist
|
||||||
|
|
||||||
|
Converts a list to a string, in the format [$item1, $item2, $item3, ...] (no prerequisites).
|
||||||
Reference in New Issue
Block a user