aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/unsafe
diff options
context:
space:
mode:
authorEduardo Julian2022-07-02 05:38:27 -0400
committerEduardo Julian2022-07-02 05:38:27 -0400
commitb96beb587c11fcfbce86ce2d62351600cf6cad1b (patch)
treec9a558ab1391ac97cb11e8777ea78299f1ab5555 /stdlib/source/unsafe
parent104130efba46a875eba566384578f8aa8593ad37 (diff)
More traditional names for unquoting macros.
Diffstat (limited to 'stdlib/source/unsafe')
-rw-r--r--stdlib/source/unsafe/lux/data/binary.lux58
-rw-r--r--stdlib/source/unsafe/lux/data/collection/array.lux114
2 files changed, 86 insertions, 86 deletions
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)) <jvm>
- (~~ (.static @.jvm)) <jvm>
+ (for (,, (.static @.old)) <jvm>
+ (,, (.static @.jvm)) <jvm>
- (~~ (.static @.js))
+ (,, (.static @.js))
(.|> <size>
.int
"lux i64 f64"
@@ -76,13 +76,13 @@
("js object new" ("js constant" "Uint8Array"))
(.as ..Binary))
- (~~ (.static @.python))
+ (,, (.static @.python))
(.|> <size>
[]
("python apply" (.as ffi.Function ("python constant" "bytearray")))
(.as ..Binary))
- (~~ (.static @.scheme))
+ (,, (.static @.scheme))
(..make-bytevector <size>)
... Default
@@ -93,22 +93,22 @@
(def .public size
(template (size it)
[(.is .Nat
- (.for (~~ (.static @.old)) <jvm>
- (~~ (.static @.jvm)) <jvm>
+ (.for (,, (.static @.old)) <jvm>
+ (,, (.static @.jvm)) <jvm>
- (~~ (.static @.js))
+ (,, (.static @.js))
(.|> <it>
("js object get" "length")
(.as .Frac)
"lux f64 i64"
.nat)
- (~~ (.static @.python))
+ (,, (.static @.python))
(.|> <it>
(.as (array.Array (.I64 .Any)))
"python array length")
- (~~ (.static @.scheme))
+ (,, (.static @.scheme))
(..bytevector-length [<it>])
... Default
@@ -130,10 +130,10 @@
(template (bits_8 index it)
[(.<| (.as .I64)
(.is (.I64 .Any))
- (`` (.for (~~ (.static @.old)) (~~ <jvm>)
- (~~ (.static @.jvm)) (~~ <jvm>)
+ (`` (.for (,, (.static @.old)) (,, <jvm>)
+ (,, (.static @.jvm)) (,, <jvm>)
- (~~ (.static @.js))
+ (,, (.static @.js))
(.|> <it>
(.as (array.Array .Frac))
("js array read" <index>)
@@ -141,12 +141,12 @@
"lux f64 i64"
.i64)
- (~~ (.static @.python))
+ (,, (.static @.python))
(.|> <it>
(.as (array.Array .I64))
("python array read" <index>))
- (~~ (.static @.scheme))
+ (,, (.static @.scheme))
(..bytevector-u8-ref [<it> <index>])
... Default
@@ -196,10 +196,10 @@
<it> (.is ..Binary it)
<index> (.is .Nat index)
<value> (.is (.I64 .Any) value)
- <jvm_value> (`` (.for (~~ (.static @.old))
+ <jvm_value> (`` (.for (,, (.static @.old))
(.as .Int <value>)
- (~~ (.static @.jvm))
+ (,, (.static @.jvm))
(.as (.Primitive "java.lang.Long") <value>)
<value>))
<jvm_value> <jvm_value>
@@ -208,10 +208,10 @@
(`` (def .public has_8!
(template (has_8! index value it)
[(.is ..Binary
- (.for (~~ (.static @.old)) <jvm>
- (~~ (.static @.jvm)) <jvm>
+ (.for (,, (.static @.old)) <jvm>
+ (,, (.static @.jvm)) <jvm>
- (~~ (.static @.js))
+ (,, (.static @.js))
(.|> <it>
(.is ..Binary)
(.as (array.Array .Frac))
@@ -223,14 +223,14 @@
.as_expected))
(.as ..Binary))
- (~~ (.static @.python))
+ (,, (.static @.python))
(.|> <it>
(.is ..Binary)
(.as (array.Array (.I64 .Any)))
("python array write" <index> (.|> <value> ("lux i64 and" <byte>) (.is (.I64 .Any))))
(.as ..Binary))
- (~~ (.static @.scheme))
+ (,, (.static @.scheme))
(.let [it' <it>]
(.exec
(..bytevector-u8-set! [it' <index> <value>])
@@ -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 @@
<jvm> (ffi.of_boolean <jvm>)]
(`` (def .public =
(template (= reference' sample')
- [(.for (~~ (.static @.old)) <jvm>
- (~~ (.static @.jvm)) <jvm>
+ [(.for (,, (.static @.old)) <jvm>
+ (,, (.static @.jvm)) <jvm>
(.let [reference <reference>
sample <sample>
limit (..size reference)]
@@ -313,8 +313,8 @@
<jvm> (.exec
<jvm>
target)]
- (.for (~~ (.static @.old)) <jvm>
- (~~ (.static @.jvm)) <jvm>
+ (.for (,, (.static @.old)) <jvm>
+ (,, (.static @.jvm)) <jvm>
... Default
(.loop (again [index 0])
@@ -334,8 +334,8 @@
<jvm>)]
(inlined .public (slice offset size binary)
(-> .Nat .Nat ..Binary ..Binary)
- (.for (~~ (.static @.old)) <jvm>
- (~~ (.static @.jvm)) <jvm>
+ (.for (,, (.static @.old)) <jvm>
+ (,, (.static @.jvm)) <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 <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 =