aboutsummaryrefslogtreecommitdiff
path: root/new-luxc/source/luxc/lang/translation/procedure
diff options
context:
space:
mode:
Diffstat (limited to 'new-luxc/source/luxc/lang/translation/procedure')
-rw-r--r--new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux6
-rw-r--r--new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux66
2 files changed, 36 insertions, 36 deletions
diff --git a/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux b/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux
index 80becb058..8c7668383 100644
--- a/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/procedure/common.jvm.lux
@@ -74,20 +74,20 @@
" Actual: " (|> actual nat-to-int %i)))
(syntax: (arity: [name s;local-symbol] [arity s;nat])
- (with-gensyms [g!proc g!name g!generate g!inputs]
+ (with-gensyms [g!proc g!name g!translate g!inputs]
(do @
[g!input+ (monad;seq @ (list;repeat arity (meta;gensym "input")))]
(wrap (list (` (def: #export ((~ (code;local-symbol name)) (~ g!proc))
(-> (-> (;;Vector (~ (code;nat arity)) $;Inst) $;Inst)
(-> Text ;;Proc))
(function [(~ g!name)]
- (function [(~ g!generate) (~ g!inputs)]
+ (function [(~ g!translate) (~ g!inputs)]
(case (~ g!inputs)
(^ (list (~@ g!input+)))
(do meta;Monad<Meta>
[(~@ (|> g!input+
(list/map (function [g!input]
- (list g!input (` ((~ g!generate) (~ g!input))))))
+ (list g!input (` ((~ g!translate) (~ g!input))))))
list;concat))]
((~' wrap) ((~ g!proc) [(~@ g!input+)])))
diff --git a/new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux b/new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux
index c222e42cf..7168514c1 100644
--- a/new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux
+++ b/new-luxc/source/luxc/lang/translation/procedure/host.jvm.lux
@@ -273,12 +273,12 @@
$i;I2L
($i;wrap #$;Long)))
-(def: (array//new proc generate inputs)
+(def: (array//new proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list [_ (#;Nat level)] [_ (#;Text class)] lengthS))
(do meta;Monad<Meta>
- [lengthI (generate lengthS)
+ [lengthI (translate lengthS)
#let [arrayJT ($t;array level (case class
"boolean" $t;boolean
"byte" $t;byte
@@ -297,13 +297,13 @@
_
(&;fail (format "Wrong syntax for '" proc "'."))))
-(def: (array//read proc generate inputs)
+(def: (array//read proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list [_ (#;Text class)] idxS arrayS))
(do meta;Monad<Meta>
- [arrayI (generate arrayS)
- idxI (generate idxS)
+ [arrayI (translate arrayS)
+ idxI (translate idxS)
#let [loadI (case class
"boolean" (|>. $i;BALOAD ($i;wrap #$;Boolean))
"byte" (|>. $i;BALOAD ($i;wrap #$;Byte))
@@ -323,14 +323,14 @@
_
(&;fail (format "Wrong syntax for '" proc "'."))))
-(def: (array//write proc generate inputs)
+(def: (array//write proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list [_ (#;Text class)] idxS valueS arrayS))
(do meta;Monad<Meta>
- [arrayI (generate arrayS)
- idxI (generate idxS)
- valueI (generate valueS)
+ [arrayI (translate arrayS)
+ idxI (translate idxS)
+ valueI (translate valueS)
#let [storeI (case class
"boolean" (|>. ($i;unwrap #$;Boolean) $i;BASTORE)
"byte" (|>. ($i;unwrap #$;Byte) $i;BASTORE)
@@ -392,7 +392,7 @@
(|>. exceptionI
$i;ATHROW))
-(def: (object//class proc generate inputs)
+(def: (object//class proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list [_ (#;Text class)]))
@@ -408,12 +408,12 @@
_
(&;fail (format "Wrong syntax for '" proc "'."))))
-(def: (object//instance? proc generate inputs)
+(def: (object//instance? proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list [_ (#;Text class)] objectS))
(do meta;Monad<Meta>
- [objectI (generate objectS)]
+ [objectI (translate objectS)]
(wrap (|>. objectI
($i;INSTANCEOF class)
($i;wrap #$;Boolean))))
@@ -445,7 +445,7 @@
["char" #$;Char])
(dict;from-list text;Hash<Text>)))
-(def: (static//get proc generate inputs)
+(def: (static//get proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list [_ (#;Text class)] [_ (#;Text field)] [_ (#;Text unboxed)]))
@@ -472,12 +472,12 @@
_
(&;fail (format "Wrong syntax for '" proc "'."))))
-(def: (static//put proc generate inputs)
+(def: (static//put proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list [_ (#;Text class)] [_ (#;Text field)] [_ (#;Text unboxed)] valueS))
(do meta;Monad<Meta>
- [valueI (generate valueS)]
+ [valueI (translate valueS)]
(case (dict;get unboxed primitives)
(#;Some primitive)
(let [primitive (case unboxed
@@ -504,12 +504,12 @@
_
(&;fail (format "Wrong syntax for '" proc "'."))))
-(def: (virtual//get proc generate inputs)
+(def: (virtual//get proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list [_ (#;Text class)] [_ (#;Text field)] [_ (#;Text unboxed)] objectS))
(do meta;Monad<Meta>
- [objectI (generate objectS)]
+ [objectI (translate objectS)]
(case (dict;get unboxed primitives)
(#;Some primitive)
(let [primitive (case unboxed
@@ -535,13 +535,13 @@
_
(&;fail (format "Wrong syntax for '" proc "'."))))
-(def: (virtual//put proc generate inputs)
+(def: (virtual//put proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list [_ (#;Text class)] [_ (#;Text field)] [_ (#;Text unboxed)] valueS objectS))
(do meta;Monad<Meta>
- [valueI (generate valueS)
- objectI (generate objectS)]
+ [valueI (translate valueS)
+ objectI (translate objectS)]
(case (dict;get unboxed primitives)
(#;Some primitive)
(let [primitive (case unboxed
@@ -597,7 +597,7 @@
nesting (p;some (l;this "[]"))]
(wrap ($t;array (list;size nesting) raw))))
-(def: (generate-type argD)
+(def: (translate-type argD)
(-> Text (Meta $;Type))
(case (l;run argD java-type)
(#e;Error error)
@@ -623,7 +623,7 @@
_
(|>. inputI ($i;CHECKCAST ($t;descriptor inputT)))))
-(def: (generate-args generate argsS)
+(def: (translate-args translate argsS)
(-> (-> ls;Synthesis (Meta $;Inst)) (List ls;Synthesis)
(Meta (List [$;Type $;Inst])))
(case argsS
@@ -632,9 +632,9 @@
(^ (list& [_ (#;Tuple (list [_ (#;Text argD)] argS))] tail))
(do meta;Monad<Meta>
- [argT (generate-type argD)
- argI (:: @ map (prepare-input argT) (generate argS))
- =tail (generate-args generate tail)]
+ [argT (translate-type argD)
+ argI (:: @ map (prepare-input argT) (translate argS))
+ =tail (translate-args translate tail)]
(wrap (list& [argT argI] =tail)))
_
@@ -647,7 +647,7 @@
(meta/wrap #;None)
_
- (:: meta;Monad<Meta> map (|>. #;Some) (generate-type description))))
+ (:: meta;Monad<Meta> map (|>. #;Some) (translate-type description))))
(def: (prepare-return returnT returnI)
(-> (Maybe $;Type) $;Inst $;Inst)
@@ -664,13 +664,13 @@
_
returnI)))
-(def: (invoke//static proc generate inputs)
+(def: (invoke//static proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list& [_ (#;Text class)] [_ (#;Text method)]
[_ (#;Text unboxed)] argsS))
(do meta;Monad<Meta>
- [argsTI (generate-args generate argsS)
+ [argsTI (translate-args translate argsS)
returnT (method-return-type unboxed)
#let [callI (|>. ($i;fuse (list/map product;right argsTI))
($i;INVOKESTATIC class method
@@ -682,14 +682,14 @@
(&;fail (format "Wrong syntax for '" proc "'."))))
(do-template [<name> <invoke> <interface?>]
- [(def: (<name> proc generate inputs)
+ [(def: (<name> proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list& [_ (#;Text class)] [_ (#;Text method)]
[_ (#;Text unboxed)] objectS argsS))
(do meta;Monad<Meta>
- [objectI (generate objectS)
- argsTI (generate-args generate argsS)
+ [objectI (translate objectS)
+ argsTI (translate-args translate argsS)
returnT (method-return-type unboxed)
#let [callI (|>. objectI
($i;CHECKCAST class)
@@ -707,12 +707,12 @@
[invoke//interface $i;INVOKEINTERFACE true]
)
-(def: (invoke//constructor proc generate inputs)
+(def: (invoke//constructor proc translate inputs)
(-> Text @;Proc)
(case inputs
(^ (list& [_ (#;Text class)] argsS))
(do meta;Monad<Meta>
- [argsTI (generate-args generate argsS)]
+ [argsTI (translate-args translate argsS)]
(wrap (|>. ($i;NEW class)
$i;DUP
($i;fuse (list/map product;right argsTI))