aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/lux/target/jvm/instruction/bytecode.lux
diff options
context:
space:
mode:
authorEduardo Julian2019-07-26 21:23:27 -0400
committerEduardo Julian2019-07-26 21:23:27 -0400
commita0889b2ee76c1ae7a9a5bbe2eec9f051b4f341e4 (patch)
tree08df3db7f8fffad6360a476d20db1d40b36c85cb /stdlib/source/lux/target/jvm/instruction/bytecode.lux
parent78fd01f7e6688448bbd710336d4d7b1c35ae058a (diff)
No more "n/"-prefixed functions.
Diffstat (limited to '')
-rw-r--r--stdlib/source/lux/target/jvm/instruction/bytecode.lux41
1 files changed, 21 insertions, 20 deletions
diff --git a/stdlib/source/lux/target/jvm/instruction/bytecode.lux b/stdlib/source/lux/target/jvm/instruction/bytecode.lux
index bef2628f6..8a51097b7 100644
--- a/stdlib/source/lux/target/jvm/instruction/bytecode.lux
+++ b/stdlib/source/lux/target/jvm/instruction/bytecode.lux
@@ -7,8 +7,9 @@
["." try (#+ Try)]
["." exception (#+ exception:)]]
[data
- [number (#+ hex)]
["." binary]
+ [number (#+ hex)
+ ["n" nat]]
[text
["%" format (#+ format)]]
[format
@@ -53,13 +54,13 @@
(def: (nullary' code)
(-> Code Mutation)
(function (_ [offset binary])
- [(n/+ 1 offset)
+ [(n.+ 1 offset)
(try.assume
(binary.write/8 offset code binary))]))
(def: (nullary code [size mutation])
(-> Code (-> Specification Specification))
- [(n/+ 1 size)
+ [(n.+ 1 size)
(|>> mutation ((nullary' code)))])
(template [<shift> <name> <inputT> <writer> <unwrap>]
@@ -67,15 +68,15 @@
(def: (<private> code input0)
(-> Code <inputT> Mutation)
(function (_ [offset binary])
- [(n/+ <shift> offset)
+ [(n.+ <shift> offset)
(try.assume
(do try.monad
[_ (binary.write/8 offset code binary)]
- (<writer> (n/+ 1 offset) (<unwrap> input0) binary)))]))
+ (<writer> (n.+ 1 offset) (<unwrap> input0) binary)))]))
(def: (<name> code input0 [size mutation])
(-> Code <inputT> (-> Specification Specification))
- [(n/+ <shift> size)
+ [(n.+ <shift> size)
(|>> mutation ((<private> code input0)))]))]
[2 unary/1 U1 binary.write/8 ///unsigned.nat]
@@ -87,47 +88,47 @@
(def: (binary/11' code input0 input1)
(-> Code U1 U1 Mutation)
(function (_ [offset binary])
- [(n/+ 3 offset)
+ [(n.+ 3 offset)
(try.assume
(do try.monad
[_ (binary.write/8 offset code binary)
- _ (binary.write/8 (n/+ 1 offset) (///unsigned.nat input0) binary)]
- (binary.write/8 (n/+ 2 offset) (///unsigned.nat input1) binary)))]))
+ _ (binary.write/8 (n.+ 1 offset) (///unsigned.nat input0) binary)]
+ (binary.write/8 (n.+ 2 offset) (///unsigned.nat input1) binary)))]))
(def: (binary/11 code input0 input1 [size mutation])
(-> Code U1 U1 (-> Specification Specification))
- [(n/+ 3 size)
+ [(n.+ 3 size)
(|>> mutation ((binary/11' code input0 input1)))])
(def: (binary/21' code input0 input1)
(-> Code U2 U1 Mutation)
(function (_ [offset binary])
- [(n/+ 4 offset)
+ [(n.+ 4 offset)
(try.assume
(do try.monad
[_ (binary.write/8 offset code binary)
- _ (binary.write/16 (n/+ 1 offset) (///unsigned.nat input0) binary)]
- (binary.write/8 (n/+ 3 offset) (///unsigned.nat input1) binary)))]))
+ _ (binary.write/16 (n.+ 1 offset) (///unsigned.nat input0) binary)]
+ (binary.write/8 (n.+ 3 offset) (///unsigned.nat input1) binary)))]))
(def: (binary/21 code input0 input1 [size mutation])
(-> Code U2 U1 (-> Specification Specification))
- [(n/+ 4 size)
+ [(n.+ 4 size)
(|>> mutation ((binary/21' code input0 input1)))])
(def: (trinary/211' code input0 input1 input2)
(-> Code U2 U1 U1 Mutation)
(function (_ [offset binary])
- [(n/+ 5 offset)
+ [(n.+ 5 offset)
(try.assume
(do try.monad
[_ (binary.write/8 offset code binary)
- _ (binary.write/16 (n/+ 1 offset) (///unsigned.nat input0) binary)
- _ (binary.write/8 (n/+ 3 offset) (///unsigned.nat input1) binary)]
- (binary.write/8 (n/+ 4 offset) (///unsigned.nat input2) binary)))]))
+ _ (binary.write/16 (n.+ 1 offset) (///unsigned.nat input0) binary)
+ _ (binary.write/8 (n.+ 3 offset) (///unsigned.nat input1) binary)]
+ (binary.write/8 (n.+ 4 offset) (///unsigned.nat input2) binary)))]))
(def: (trinary/211 code input0 input1 input2 [size mutation])
(-> Code U2 U1 U1 (-> Specification Specification))
- [(n/+ 5 size)
+ [(n.+ 5 size)
(|>> mutation ((trinary/211' code input0 input1 input2)))])
(abstract: #export Primitive-Array-Type
@@ -483,7 +484,7 @@
(def: identity ..nop)
(def: (compose [left-size left] [right-size right])
- [(n/+ left-size right-size)
+ [(n.+ left-size right-size)
(function (_ input)
(do try.monad
[temp (left input)]