diff options
Diffstat (limited to 'stdlib/source/lux/host/jvm/encoding.lux')
-rw-r--r-- | stdlib/source/lux/host/jvm/encoding.lux | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/stdlib/source/lux/host/jvm/encoding.lux b/stdlib/source/lux/host/jvm/encoding.lux index 6d8afe348..2b2c487ec 100644 --- a/stdlib/source/lux/host/jvm/encoding.lux +++ b/stdlib/source/lux/host/jvm/encoding.lux @@ -11,12 +11,14 @@ [type abstract]]) -(do-template [<name> <bytes> <to> <from>] +(do-template [<bytes> <name> <size> <to> <from>] [(abstract: #export <name> {} (I64 Any) + (def: #export <size> Nat <bytes>) + (def: #export <to> (-> (I64 Any) <name>) (let [mask (|> <bytes> @@ -33,9 +35,9 @@ ("lux i64 =" (:representation reference) (:representation sample)))) )] - [U1 1 to-u1 from-u1] - [U2 2 to-u2 from-u2] - [U4 4 to-u4 from-u4] + [1 U1 u1-bytes to-u1 from-u1] + [2 U2 u2-bytes to-u2 from-u2] + [4 U4 u4-bytes to-u4 from-u4] ) (do-template [<name> <type> <format> <pre-write> <post-read>] |