update to the sorting functions and small fix to the compiler it self

This commit is contained in:
igor
2026-02-19 10:42:53 +01:00
parent f3de51f5d8
commit 2b311c7be7
3 changed files with 138 additions and 35 deletions

View File

@@ -2,17 +2,13 @@ import ../stdlib/stdlib.sl
import ../stdlib/io.sl
import ../stdlib/arr.sl
word free_static
dup @ 1 + 8 * free
end
word main
[ 4 1 3 2 ] dup arr_sort
dup 0 swap arr_get_static puti cr
dup 1 swap arr_get_static puti cr
dup 2 swap arr_get_static puti cr
dup 3 swap arr_get_static puti cr
free_static
arr_static_free
[ 9 5 7 ] dup arr_sorted
dup 0 swap arr_get_static puti cr
@@ -24,6 +20,6 @@ word main
dup 1 swap arr_get_static puti cr
dup 2 swap arr_get_static puti cr
free_static
free_static
arr_static_free
arr_static_free
end