diff options
author | Eduardo Julian | 2018-05-06 03:30:47 -0400 |
---|---|---|
committer | Eduardo Julian | 2018-05-06 03:30:47 -0400 |
commit | e65e734e5df3746ffb7df2cc9fa33826e0083fcd (patch) | |
tree | c67b1105a4b421d527804ccbfcab4d29ec20e744 /stdlib/source/lux/macro | |
parent | f5a6fe62a612c0727063fa9e530d53ddda5fcd82 (diff) |
- Re-named shift-left -> left-shift, shift-right -> logical-right-shift, signed-shift-right -> arithmetic-right-shift.
Diffstat (limited to 'stdlib/source/lux/macro')
-rw-r--r-- | stdlib/source/lux/macro/poly/json.lux | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/stdlib/source/lux/macro/poly/json.lux b/stdlib/source/lux/macro/poly/json.lux index 971048296..2e288648e 100644 --- a/stdlib/source/lux/macro/poly/json.lux +++ b/stdlib/source/lux/macro/poly/json.lux @@ -39,12 +39,12 @@ (function (_ input) (non-rec (rec-encode non-rec) input))) -(def: low-mask Nat (|> +1 (bit.shift-left +32) n/dec)) -(def: high-mask Nat (|> low-mask (bit.shift-left +32))) +(def: low-mask Nat (|> +1 (bit.left-shift +32) n/dec)) +(def: high-mask Nat (|> low-mask (bit.left-shift +32))) (struct: _ (Codec JSON Nat) (def: (encode input) - (let [high (|> input (bit.and high-mask) (bit.shift-right +32)) + (let [high (|> input (bit.and high-mask) (bit.logical-right-shift +32)) low (bit.and low-mask input)] (#//.Array (sequence (|> high nat-to-int int-to-frac #//.Number) (|> low nat-to-int int-to-frac #//.Number))))) @@ -54,7 +54,7 @@ (do p.Monad<Parser> [high //.number low //.number]) - (wrap (n/+ (|> high frac-to-int int-to-nat (bit.shift-left +32)) + (wrap (n/+ (|> high frac-to-int int-to-nat (bit.left-shift +32)) (|> low frac-to-int int-to-nat)))))) (struct: _ (Codec JSON Int) |