Lists package
This commit is contained in:
@@ -3,9 +3,10 @@ fun -string !ltos -list &inlist
|
||||
getlistsize *inlist &listlen
|
||||
set &idx 0
|
||||
set &ans ""
|
||||
add $ans '[' &ans
|
||||
add $ans "[" &ans
|
||||
@stdoutloop
|
||||
getlistat *inlist $idx &store
|
||||
tostring $store &store
|
||||
add $ans $store &ans
|
||||
add $idx 1 &idx
|
||||
equal $idx $listlen &store
|
||||
@@ -16,9 +17,4 @@ fun -string !ltos -list &inlist
|
||||
@trueend
|
||||
add $ans "]" &ans
|
||||
return $ans
|
||||
endfun
|
||||
|
||||
setlist *store 4 2 "Hello"
|
||||
pusharg *store
|
||||
call !ltos &store
|
||||
stdlnout $store
|
||||
endfun
|
||||
@@ -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