aboutsummaryrefslogtreecommitdiff
path: root/lux-jvm/source/luxc/lang/translation/jvm.lux
diff options
context:
space:
mode:
Diffstat (limited to 'lux-jvm/source/luxc/lang/translation/jvm.lux')
-rw-r--r--lux-jvm/source/luxc/lang/translation/jvm.lux58
1 files changed, 30 insertions, 28 deletions
diff --git a/lux-jvm/source/luxc/lang/translation/jvm.lux b/lux-jvm/source/luxc/lang/translation/jvm.lux
index 0f6ba6744..425a259aa 100644
--- a/lux-jvm/source/luxc/lang/translation/jvm.lux
+++ b/lux-jvm/source/luxc/lang/translation/jvm.lux
@@ -122,7 +122,7 @@
..value_field ..$Value)
(def.method #jvm.Public ($_ jvm.++M jvm.staticM jvm.strictM)
"<clinit>"
- (type.method [(list) type.void (list)])
+ (type.method [(list) (list) type.void (list)])
(|>> valueI
(inst.PUTSTATIC (type.class bytecode_name (list)) ..value_field ..$Value)
inst.RETURN))))]
@@ -155,35 +155,37 @@
value definition])))
(def: #export host
- (IO Host)
+ (IO [java/lang/ClassLoader Host])
(io (let [library (loader.new_library [])
loader (loader.memory library)]
- (: Host
- (implementation
- (def: (evaluate! context valueI)
- (\ try.monad map product.left
- (..evaluate! library loader context valueI)))
-
- (def: execute!
- (..execute! library loader))
-
- (def: define!
- (..define! library loader))
-
- (def: (ingest context bytecode)
- [(..class_name context) bytecode])
-
- (def: (re_learn context custom [_ bytecode])
- (io.run
- (loader.store (maybe.default (..class_name context) custom) bytecode library)))
-
- (def: (re_load context custom [_ bytecode])
- (io.run
- (do (try.with io.monad)
- [#let [class_name (maybe.default (..class_name context) custom)]
- _ (loader.store class_name bytecode library)
- class (loader.load class_name loader)]
- (\ io.monad wrap (..class_value class_name class))))))))))
+ [loader
+ (: Host
+ (implementation
+ (def: (evaluate! context valueI)
+ (\ try.monad map product.left
+ (..evaluate! library loader context valueI)))
+
+ (def: execute!
+ (..execute! library loader))
+
+ (def: define!
+ (..define! library loader))
+
+ (def: (ingest context bytecode)
+ [(..class_name context) bytecode])
+
+ (def: (re_learn context custom [_ bytecode])
+ (io.run
+ (loader.store (maybe.default (..class_name context) custom) bytecode library)))
+
+ (def: (re_load context custom [directive_name bytecode])
+ (io.run
+ (do (try.with io.monad)
+ [#let [class_name (maybe.default (..class_name context)
+ custom)]
+ _ (loader.store class_name bytecode library)
+ class (loader.load class_name loader)]
+ (\ io.monad wrap (..class_value class_name class)))))))])))
(def: #export $Variant
(type.array ..$Value))