From 5f65c1b42b7938902ce7db4bcf96f6df334d0f93 Mon Sep 17 00:00:00 2001 From: DiamondNether90 Date: Thu, 18 Sep 2025 19:57:24 +1000 Subject: [PATCH] Lists package --- packages/lists/lists.grnd | 10 +++------- packages/lists/readme.md | 12 +++++++++++- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/packages/lists/lists.grnd b/packages/lists/lists.grnd index 3617706..cd60284 100644 --- a/packages/lists/lists.grnd +++ b/packages/lists/lists.grnd @@ -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 \ No newline at end of file +endfun \ No newline at end of file diff --git a/packages/lists/readme.md b/packages/lists/readme.md index bdf86e8..9a9640d 100644 --- a/packages/lists/readme.md +++ b/packages/lists/readme.md @@ -1 +1,11 @@ -### Due to the current limitations of ground, this package is not ready for use. \ No newline at end of file +# 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). \ No newline at end of file