diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/unsafe/lux/data/collection/array.lux | 114 |
1 files changed, 57 insertions, 57 deletions
diff --git a/stdlib/source/unsafe/lux/data/collection/array.lux b/stdlib/source/unsafe/lux/data/collection/array.lux index a4c3bf01e..cd901c24c 100644 --- a/stdlib/source/unsafe/lux/data/collection/array.lux +++ b/stdlib/source/unsafe/lux/data/collection/array.lux @@ -37,30 +37,30 @@ [((.is (.All (_ a) (.-> .Nat (..Array a))) (.function (empty size) (.as_expected - (.for (~~ (.static @.old)) + (.for (,, (.static @.old)) ("jvm anewarray" "(java.lang.Object )" size) - (~~ (.static @.jvm)) - (|> (~~ (..jvm_int size)) + (,, (.static @.jvm)) + (|> (,, (..jvm_int size)) "jvm array new object" (.is (..Array <item_type>))) - (~~ (.static @.js)) ("js array new" size) - (~~ (.static @.python)) ("python array new" size) - (~~ (.static @.lua)) ("lua array new" size) - (~~ (.static @.ruby)) ("ruby array new" size) - (~~ (.static @.php)) ("php array new" size) - (~~ (.static @.scheme)) ("scheme array new" size))))) + (,, (.static @.js)) ("js array new" size) + (,, (.static @.python)) ("python array new" size) + (,, (.static @.lua)) ("lua array new" size) + (,, (.static @.ruby)) ("ruby array new" size) + (,, (.static @.php)) ("php array new" size) + (,, (.static @.scheme)) ("scheme array new" size))))) <size>)]))) (`` (def .public size (template (size <array>) [((.is (.All (_ r w) (.-> (..Array' r w) .Nat)) (.function (size array) - (.for (~~ (.static @.old)) + (.for (,, (.static @.old)) ("jvm arraylength" array) - (~~ (.static @.jvm)) + (,, (.static @.jvm)) (.|> array "jvm array length object" "jvm conversion int-to-long" @@ -68,12 +68,12 @@ (.is <index_type>) (.as .Nat)) - (~~ (.static @.js)) ("js array length" array) - (~~ (.static @.python)) ("python array length" array) - (~~ (.static @.lua)) ("lua array length" array) - (~~ (.static @.ruby)) ("ruby array length" array) - (~~ (.static @.php)) ("php array length" array) - (~~ (.static @.scheme)) ("scheme array length" array)))) + (,, (.static @.js)) ("js array length" array) + (,, (.static @.python)) ("python array length" array) + (,, (.static @.lua)) ("lua array length" array) + (,, (.static @.ruby)) ("ruby array length" array) + (,, (.static @.php)) ("php array length" array) + (,, (.static @.scheme)) ("scheme array length" array)))) <array>)]))) (def lacks?' @@ -87,20 +87,20 @@ (.function (lacks? index array) (.let [size (..size array)] (.if ("lux i64 <" (.int size) (.int index)) - (.for (~~ (.static @.old)) + (.for (,, (.static @.old)) ("jvm object null?" ("jvm aaload" array index)) - (~~ (.static @.jvm)) + (,, (.static @.jvm)) (.|> array - ("jvm array read object" (~~ (jvm_int index))) + ("jvm array read object" (,, (jvm_int index))) "jvm object null?") - (~~ (.static @.js)) (~~ (lacks?' "js array read" "js object undefined?" index array)) - (~~ (.static @.python)) (~~ (lacks?' "python array read" "python object none?" index array)) - (~~ (.static @.lua)) (~~ (lacks?' "lua array read" "lua object nil?" index array)) - (~~ (.static @.ruby)) (~~ (lacks?' "ruby array read" "ruby object nil?" index array)) - (~~ (.static @.php)) (~~ (lacks?' "php array read" "php object null?" index array)) - (~~ (.static @.scheme)) (~~ (lacks?' "scheme array read" "scheme object nil?" index array))) + (,, (.static @.js)) (,, (lacks?' "js array read" "js object undefined?" index array)) + (,, (.static @.python)) (,, (lacks?' "python array read" "python object none?" index array)) + (,, (.static @.lua)) (,, (lacks?' "lua array read" "lua object nil?" index array)) + (,, (.static @.ruby)) (,, (lacks?' "ruby array read" "ruby object nil?" index array)) + (,, (.static @.php)) (,, (lacks?' "php array read" "php object null?" index array)) + (,, (.static @.scheme)) (,, (lacks?' "scheme array read" "scheme object nil?" index array))) .true)))) <index> <array>)]))) @@ -114,18 +114,18 @@ (.-> .Nat (..Array' r w) r)) (.function (item index array) (.as_expected - (.for (~~ (.static @.old)) + (.for (,, (.static @.old)) ("jvm aaload" array index) - (~~ (.static @.jvm)) - ("jvm array read object" (~~ (jvm_int index)) array) + (,, (.static @.jvm)) + ("jvm array read object" (,, (jvm_int index)) array) - (~~ (.static @.js)) ("js array read" index array) - (~~ (.static @.python)) ("python array read" index array) - (~~ (.static @.lua)) ("lua array read" index array) - (~~ (.static @.ruby)) ("ruby array read" index array) - (~~ (.static @.php)) ("php array read" index array) - (~~ (.static @.scheme)) ("scheme array read" index array))))) + (,, (.static @.js)) ("js array read" index array) + (,, (.static @.python)) ("python array read" index array) + (,, (.static @.lua)) ("lua array read" index array) + (,, (.static @.ruby)) ("ruby array read" index array) + (,, (.static @.php)) ("php array read" index array) + (,, (.static @.scheme)) ("scheme array read" index array))))) <index> <array>)]))) (`` (def .public has! @@ -133,20 +133,20 @@ [((.is (.All (_ r w) (.-> .Nat w (..Array' r w) (..Array' r w))) (.function (has! index value array) - (.for (~~ (.static @.old)) + (.for (,, (.static @.old)) ("jvm aastore" array index value) - (~~ (.static @.jvm)) + (,, (.static @.jvm)) (.|> array - ("jvm array write object" (~~ (jvm_int index)) value) + ("jvm array write object" (,, (jvm_int index)) value) .as_expected) - (~~ (.static @.js)) ("js array write" index (.as_expected value) array) - (~~ (.static @.python)) ("python array write" index (.as_expected value) array) - (~~ (.static @.lua)) ("lua array write" index (.as_expected value) array) - (~~ (.static @.ruby)) ("ruby array write" index (.as_expected value) array) - (~~ (.static @.php)) ("php array write" index (.as_expected value) array) - (~~ (.static @.scheme)) ("scheme array write" index (.as_expected value) array)))) + (,, (.static @.js)) ("js array write" index (.as_expected value) array) + (,, (.static @.python)) ("python array write" index (.as_expected value) array) + (,, (.static @.lua)) ("lua array write" index (.as_expected value) array) + (,, (.static @.ruby)) ("ruby array write" index (.as_expected value) array) + (,, (.static @.php)) ("php array write" index (.as_expected value) array) + (,, (.static @.scheme)) ("scheme array write" index (.as_expected value) array)))) <index> <value> <array>)]))) (`` (def .public lacks! @@ -156,18 +156,18 @@ (.function (lacks! index array) (.let [size (..size array)] (.if ("lux i64 <" (.int size) (.int index)) - (.for (~~ (.static @.old)) + (.for (,, (.static @.old)) (..has! index (.as_expected ("jvm object null")) array) - (~~ (.static @.jvm)) + (,, (.static @.jvm)) (..has! index (.as_expected (is <item_type> ("jvm object null"))) array) - (~~ (.static @.js)) ("js array delete" index array) - (~~ (.static @.python)) ("python array delete" index array) - (~~ (.static @.lua)) ("lua array delete" index array) - (~~ (.static @.ruby)) ("ruby array delete" index array) - (~~ (.static @.php)) ("php array delete" index array) - (~~ (.static @.scheme)) ("scheme array delete" index array)) + (,, (.static @.js)) ("js array delete" index array) + (,, (.static @.python)) ("python array delete" index array) + (,, (.static @.lua)) ("lua array delete" index array) + (,, (.static @.ruby)) ("ruby array delete" index array) + (,, (.static @.php)) ("php array delete" index array) + (,, (.static @.scheme)) ("scheme array delete" index array)) array)))) <index> <array>)]))) ) @@ -307,7 +307,7 @@ (.function (list|-default empty array) (.loop (again [index ("lux i64 -" 1 (..size array)) output empty]) - (.if ("lux i64 =" (~~ (.static ..underflow)) index) + (.if ("lux i64 =" (,, (.static ..underflow)) index) output (again ("lux i64 -" 1 index) (.if (..lacks? index array) @@ -320,9 +320,9 @@ [((.is (.All (_ r w) (.-> r (..Array' r w) (.List r))) (.function (list|+default default array) (.loop (again [index ("lux i64 -" 1 (..size array)) - output (`` (.is (.List (~~ (.these (~~ (.type_of default))))) + output (`` (.is (.List (,, (.these (,, (.type_of default))))) {.#End}))]) - (.if ("lux i64 =" (~~ (.static ..underflow)) index) + (.if ("lux i64 =" (,, (.static ..underflow)) index) output (again ("lux i64 -" 1 index) {.#Item (.if (..lacks? index array) @@ -337,10 +337,10 @@ (.function (list default array) (.case default {.#Some default} - (~~ (..list|+default default array)) + (,, (..list|+default default array)) {.#None} - (~~ (..list|-default {.#End} array))))) + (,, (..list|-default {.#End} array))))) <default> <array>)]))) (def .public = |