aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/unsafe
diff options
context:
space:
mode:
authorEduardo Julian2022-03-30 19:23:12 -0400
committerEduardo Julian2022-03-30 19:23:12 -0400
commit4326d69ab717683449bf37bf8dd170c83455c0c0 (patch)
tree384442f7d0fb3c80543df9f6d6511d159b90b79f /stdlib/source/unsafe
parent9df5ff6abc6e95c766d1907c5a9fee00730e749a (diff)
Lined-up names of "safe" binary/array defs with names of "unsafe" ones.
Diffstat (limited to 'stdlib/source/unsafe')
-rw-r--r--stdlib/source/unsafe/lux/data/binary.lux58
1 files changed, 29 insertions, 29 deletions
diff --git a/stdlib/source/unsafe/lux/data/binary.lux b/stdlib/source/unsafe/lux/data/binary.lux
index bc99f1f55..33d217c40 100644
--- a/stdlib/source/unsafe/lux/data/binary.lux
+++ b/stdlib/source/unsafe/lux/data/binary.lux
@@ -198,7 +198,7 @@
<jvm_value> <jvm_value>
<jvm_value> (ffi.long_to_byte <jvm_value>)
<jvm> (ffi.write! <index> <jvm_value> <it>)]
- (`` (template: .public (with/1! index value it)
+ (`` (template: .public (has/1! index value it)
[(.is ..Binary
(.for (~~ (.static @.old)) <jvm>
(~~ (.static @.jvm)) <jvm>
@@ -230,47 +230,47 @@
... Default
(array.has! <index> (.|> <value> .int ("lux i64 and" (.int <byte>))) <it>)))])))
-(template: .public (with/2! index' value' it)
+(template: .public (has/2! index' value' it)
[(.let [index (.is .Nat index')
value (.is (.I64 .Any) value')]
(.|> it
- (..with/1! index ("lux i64 right-shift" 8 value))
- (..with/1! ("lux i64 +" 1 index) value)))])
+ (..has/1! index ("lux i64 right-shift" 8 value))
+ (..has/1! ("lux i64 +" 1 index) value)))])
-(template: .public (with/4! index' value' it)
+(template: .public (has/4! index' value' it)
[(.let [index (.is .Nat index')
value (.is (.I64 .Any) value')]
(.|> it
- (..with/1! index ("lux i64 right-shift" 24 value))
- (..with/1! ("lux i64 +" 1 index) ("lux i64 right-shift" 16 value))
- (..with/1! ("lux i64 +" 2 index) ("lux i64 right-shift" 8 value))
- (..with/1! ("lux i64 +" 3 index) value)))])
+ (..has/1! index ("lux i64 right-shift" 24 value))
+ (..has/1! ("lux i64 +" 1 index) ("lux i64 right-shift" 16 value))
+ (..has/1! ("lux i64 +" 2 index) ("lux i64 right-shift" 8 value))
+ (..has/1! ("lux i64 +" 3 index) value)))])
-(`` (template: .public (with/8! index' value' it)
+(`` (template: .public (has/8! index' value' it)
[(.let [index (.is .Nat index')
value (.is (.I64 .Any) value')]
(.for (~~ (.static @.scheme)) (.let [write_high (.is (.-> ..Binary ..Binary)
- (.|>> (..with/1! index ("lux i64 right-shift" 56 value))
- (..with/1! ("lux i64 +" 1 index) ("lux i64 right-shift" 48 value))
- (..with/1! ("lux i64 +" 2 index) ("lux i64 right-shift" 40 value))
- (..with/1! ("lux i64 +" 3 index) ("lux i64 right-shift" 32 value))))
+ (.|>> (..has/1! index ("lux i64 right-shift" 56 value))
+ (..has/1! ("lux i64 +" 1 index) ("lux i64 right-shift" 48 value))
+ (..has/1! ("lux i64 +" 2 index) ("lux i64 right-shift" 40 value))
+ (..has/1! ("lux i64 +" 3 index) ("lux i64 right-shift" 32 value))))
write_low (.is (.-> ..Binary ..Binary)
- (.|>> (..with/1! ("lux i64 +" 4 index) ("lux i64 right-shift" 24 value))
- (..with/1! ("lux i64 +" 5 index) ("lux i64 right-shift" 16 value))
- (..with/1! ("lux i64 +" 6 index) ("lux i64 right-shift" 8 value))
- (..with/1! ("lux i64 +" 7 index) value)))]
+ (.|>> (..has/1! ("lux i64 +" 4 index) ("lux i64 right-shift" 24 value))
+ (..has/1! ("lux i64 +" 5 index) ("lux i64 right-shift" 16 value))
+ (..has/1! ("lux i64 +" 6 index) ("lux i64 right-shift" 8 value))
+ (..has/1! ("lux i64 +" 7 index) value)))]
(.|> it
write_high
write_low))
(.|> it
- (..with/1! index ("lux i64 right-shift" 56 value))
- (..with/1! ("lux i64 +" 1 index) ("lux i64 right-shift" 48 value))
- (..with/1! ("lux i64 +" 2 index) ("lux i64 right-shift" 40 value))
- (..with/1! ("lux i64 +" 3 index) ("lux i64 right-shift" 32 value))
- (..with/1! ("lux i64 +" 4 index) ("lux i64 right-shift" 24 value))
- (..with/1! ("lux i64 +" 5 index) ("lux i64 right-shift" 16 value))
- (..with/1! ("lux i64 +" 6 index) ("lux i64 right-shift" 8 value))
- (..with/1! ("lux i64 +" 7 index) value))))]))
+ (..has/1! index ("lux i64 right-shift" 56 value))
+ (..has/1! ("lux i64 +" 1 index) ("lux i64 right-shift" 48 value))
+ (..has/1! ("lux i64 +" 2 index) ("lux i64 right-shift" 40 value))
+ (..has/1! ("lux i64 +" 3 index) ("lux i64 right-shift" 32 value))
+ (..has/1! ("lux i64 +" 4 index) ("lux i64 right-shift" 24 value))
+ (..has/1! ("lux i64 +" 5 index) ("lux i64 right-shift" 16 value))
+ (..has/1! ("lux i64 +" 6 index) ("lux i64 right-shift" 8 value))
+ (..has/1! ("lux i64 +" 7 index) value))))]))
(with_expansions [<reference> (.is ..Binary reference')
<sample> (.is ..Binary sample')
@@ -307,9 +307,9 @@
(.loop (again [index 0])
(.if ("lux i64 <" (.int bytes) (.int index))
(.exec
- (..with/1! ("lux i64 +" target_offset index)
- (..bytes/1 ("lux i64 +" source_offset index) source)
- target)
+ (..has/1! ("lux i64 +" target_offset index)
+ (..bytes/1 ("lux i64 +" source_offset index) source)
+ target)
(again ("lux i64 +" 1 index)))
target))))))