diff options
Diffstat (limited to '')
-rw-r--r-- | stdlib/source/library/lux/data/format/binary.lux | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/stdlib/source/library/lux/data/format/binary.lux b/stdlib/source/library/lux/data/format/binary.lux index cc85465f6..1d99204b6 100644 --- a/stdlib/source/library/lux/data/format/binary.lux +++ b/stdlib/source/library/lux/data/format/binary.lux @@ -76,10 +76,10 @@ (<write> offset value) try.trusted)])]))] - [bits/8 /.size/8 binary.write/8!] - [bits/16 /.size/16 binary.write/16!] - [bits/32 /.size/32 binary.write/32!] - [bits/64 /.size/64 binary.write/64!] + [bits/8 /.size/8 binary.has/1!] + [bits/16 /.size/16 binary.has/2!] + [bits/32 /.size/32 binary.has/4!] + [bits/64 /.size/64 binary.has/8!] ) (def: .public (or left right) @@ -92,7 +92,7 @@ [(.++ caseS) (function (_ [offset binary]) (|> binary - (binary.write/8! offset <number>) + (binary.has/1! offset <number>) try.trusted [(.++ offset)] caseT))])]) @@ -137,11 +137,11 @@ (function (_ [offset binary]) [(n.+ size offset) (try.trusted - (binary.copy (n.min size (binary.size value)) - 0 - value - offset - binary))])])) + (binary.copy! (n.min size (binary.size value)) + 0 + value + offset + binary))])])) (template [<name> <bits> <size> <write>] [(def: .public <name> @@ -156,12 +156,12 @@ (try.trusted (do try.monad [_ (<write> offset size binary)] - (binary.copy size 0 value (n.+ <size> offset) binary)))])]))))] + (binary.copy! size 0 value (n.+ <size> offset) binary)))])]))))] - [binary/8 ..bits/8 /.size/8 binary.write/8!] - [binary/16 ..bits/16 /.size/16 binary.write/16!] - [binary/32 ..bits/32 /.size/32 binary.write/32!] - [binary/64 ..bits/64 /.size/64 binary.write/64!] + [binary/8 ..bits/8 /.size/8 binary.has/1!] + [binary/16 ..bits/16 /.size/16 binary.has/2!] + [binary/32 ..bits/32 /.size/32 binary.has/4!] + [binary/64 ..bits/64 /.size/64 binary.has/8!] ) (template [<name> <binary>] @@ -201,10 +201,10 @@ [_ (<write> offset capped_count binary)] (in (mutation [(n.+ <size> offset) binary])))))])))] - [sequence/8 /.size/8 binary.write/8!] - [sequence/16 /.size/16 binary.write/16!] - [sequence/32 /.size/32 binary.write/32!] - [sequence/64 /.size/64 binary.write/64!] + [sequence/8 /.size/8 binary.has/1!] + [sequence/16 /.size/16 binary.has/2!] + [sequence/32 /.size/32 binary.has/4!] + [sequence/64 /.size/64 binary.has/8!] ) (def: .public maybe @@ -240,7 +240,7 @@ [(.++ caseS) (function (_ [offset binary]) (|> binary - (binary.write/8! offset <number>) + (binary.has/1! offset <number>) try.trusted [(.++ offset)] caseT))])]) @@ -275,7 +275,7 @@ [(.++ caseS) (function (_ [offset binary]) (|> binary - (binary.write/8! offset <number>) + (binary.has/1! offset <number>) try.trusted [(.++ offset)] caseT))])]) |