From b96beb587c11fcfbce86ce2d62351600cf6cad1b Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Sat, 2 Jul 2022 05:38:27 -0400 Subject: More traditional names for unquoting macros. --- stdlib/source/unsafe/lux/data/binary.lux | 58 +++++------ stdlib/source/unsafe/lux/data/collection/array.lux | 114 ++++++++++----------- 2 files changed, 86 insertions(+), 86 deletions(-) (limited to 'stdlib/source/unsafe') diff --git a/stdlib/source/unsafe/lux/data/binary.lux b/stdlib/source/unsafe/lux/data/binary.lux index aff596957..5453bbc6b 100644 --- a/stdlib/source/unsafe/lux/data/binary.lux +++ b/stdlib/source/unsafe/lux/data/binary.lux @@ -63,10 +63,10 @@ (def .public empty (template (empty size) [(is ..Binary - (for (~~ (.static @.old)) - (~~ (.static @.jvm)) + (for (,, (.static @.old)) + (,, (.static @.jvm)) - (~~ (.static @.js)) + (,, (.static @.js)) (.|> .int "lux i64 f64" @@ -76,13 +76,13 @@ ("js object new" ("js constant" "Uint8Array")) (.as ..Binary)) - (~~ (.static @.python)) + (,, (.static @.python)) (.|> [] ("python apply" (.as ffi.Function ("python constant" "bytearray"))) (.as ..Binary)) - (~~ (.static @.scheme)) + (,, (.static @.scheme)) (..make-bytevector ) ... Default @@ -93,22 +93,22 @@ (def .public size (template (size it) [(.is .Nat - (.for (~~ (.static @.old)) - (~~ (.static @.jvm)) + (.for (,, (.static @.old)) + (,, (.static @.jvm)) - (~~ (.static @.js)) + (,, (.static @.js)) (.|> ("js object get" "length") (.as .Frac) "lux f64 i64" .nat) - (~~ (.static @.python)) + (,, (.static @.python)) (.|> (.as (array.Array (.I64 .Any))) "python array length") - (~~ (.static @.scheme)) + (,, (.static @.scheme)) (..bytevector-length []) ... Default @@ -130,10 +130,10 @@ (template (bits_8 index it) [(.<| (.as .I64) (.is (.I64 .Any)) - (`` (.for (~~ (.static @.old)) (~~ ) - (~~ (.static @.jvm)) (~~ ) + (`` (.for (,, (.static @.old)) (,, ) + (,, (.static @.jvm)) (,, ) - (~~ (.static @.js)) + (,, (.static @.js)) (.|> (.as (array.Array .Frac)) ("js array read" ) @@ -141,12 +141,12 @@ "lux f64 i64" .i64) - (~~ (.static @.python)) + (,, (.static @.python)) (.|> (.as (array.Array .I64)) ("python array read" )) - (~~ (.static @.scheme)) + (,, (.static @.scheme)) (..bytevector-u8-ref [ ]) ... Default @@ -196,10 +196,10 @@ (.is ..Binary it) (.is .Nat index) (.is (.I64 .Any) value) - (`` (.for (~~ (.static @.old)) + (`` (.for (,, (.static @.old)) (.as .Int ) - (~~ (.static @.jvm)) + (,, (.static @.jvm)) (.as (.Primitive "java.lang.Long") ) )) @@ -208,10 +208,10 @@ (`` (def .public has_8! (template (has_8! index value it) [(.is ..Binary - (.for (~~ (.static @.old)) - (~~ (.static @.jvm)) + (.for (,, (.static @.old)) + (,, (.static @.jvm)) - (~~ (.static @.js)) + (,, (.static @.js)) (.|> (.is ..Binary) (.as (array.Array .Frac)) @@ -223,14 +223,14 @@ .as_expected)) (.as ..Binary)) - (~~ (.static @.python)) + (,, (.static @.python)) (.|> (.is ..Binary) (.as (array.Array (.I64 .Any))) ("python array write" (.|> ("lux i64 and" ) (.is (.I64 .Any)))) (.as ..Binary)) - (~~ (.static @.scheme)) + (,, (.static @.scheme)) (.let [it' ] (.exec (..bytevector-u8-set! [it' ]) @@ -261,7 +261,7 @@ (template (has_64! index' value' it) [(.let [index (.is .Nat index') value (.is (.I64 .Any) value')] - (.for (~~ (.static @.scheme)) (.let [write_high (.is (.-> ..Binary ..Binary) + (.for (,, (.static @.scheme)) (.let [write_high (.is (.-> ..Binary ..Binary) (.|>> (..has_8! index ("lux i64 right-shift" 56 value)) (..has_8! ("lux i64 +" 1 index) ("lux i64 right-shift" 48 value)) (..has_8! ("lux i64 +" 2 index) ("lux i64 right-shift" 40 value)) @@ -290,8 +290,8 @@ (ffi.of_boolean )] (`` (def .public = (template (= reference' sample') - [(.for (~~ (.static @.old)) - (~~ (.static @.jvm)) + [(.for (,, (.static @.old)) + (,, (.static @.jvm)) (.let [reference sample limit (..size reference)] @@ -313,8 +313,8 @@ (.exec target)] - (.for (~~ (.static @.old)) - (~~ (.static @.jvm)) + (.for (,, (.static @.old)) + (,, (.static @.jvm)) ... Default (.loop (again [index 0]) @@ -334,8 +334,8 @@ )] (inlined .public (slice offset size binary) (-> .Nat .Nat ..Binary ..Binary) - (.for (~~ (.static @.old)) - (~~ (.static @.jvm)) + (.for (,, (.static @.old)) + (,, (.static @.jvm)) ... Default (..copy! size offset binary 0 (..empty size)))))) 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 ))) - (~~ (.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))))) )]))) (`` (def .public size (template (size ) [((.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 ) (.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)))) )]))) (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)))) )]))) @@ -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))))) )]))) (`` (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)))) )]))) (`` (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 ("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)))) )]))) ) @@ -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))))) )]))) (def .public = -- cgit v1.2.3