From a62ce3f9c2b605e0033f4772b0f64c4525de4d86 Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Wed, 11 Aug 2021 02:38:59 -0400 Subject: Relocated maybe and lazy from data to control. --- lux-jvm/source/luxc/lang/translation/jvm.lux | 38 ++++++++++++++-------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'lux-jvm/source/luxc/lang/translation/jvm.lux') diff --git a/lux-jvm/source/luxc/lang/translation/jvm.lux b/lux-jvm/source/luxc/lang/translation/jvm.lux index 46242abc7..dbf49b552 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm.lux @@ -6,6 +6,7 @@ [monad (#+ do)]] [control pipe + ["." maybe] ["." try (#+ Try)] ["." exception (#+ exception:)] ["." io (#+ IO io)] @@ -14,7 +15,6 @@ [data [binary (#+ Binary)] ["." product] - ["." maybe] ["." text ("#@." hash) ["%" format (#+ format)]] [collection @@ -126,25 +126,25 @@ (|>> valueI (inst.PUTSTATIC (type.class bytecode_name (list)) ..value_field ..$Value) inst.RETURN))))] - (io.run (do (try.with io.monad) - [_ (loader.store eval_class bytecode library) - class (loader.load eval_class loader) - value (\ io.monad in (..class_value eval_class class))] - (in [value - [eval_class bytecode]]))))) + (io.run! (do (try.with io.monad) + [_ (loader.store eval_class bytecode library) + class (loader.load eval_class loader) + value (\ io.monad in (..class_value eval_class class))] + (in [value + [eval_class bytecode]]))))) (def: (execute! library loader [class_name class_bytecode]) (-> Library java/lang/ClassLoader Definition (Try Any)) - (io.run (do (try.with io.monad) - [existing_class? (|> (atom.read library) - (\ io.monad map (function (_ library) - (dictionary.key? library class_name))) - (try.lifted io.monad) - (: (IO (Try Bit)))) - _ (if existing_class? - (in []) - (loader.store class_name class_bytecode library))] - (loader.load class_name loader)))) + (io.run! (do (try.with io.monad) + [existing_class? (|> (atom.read library) + (\ io.monad map (function (_ library) + (dictionary.key? library class_name))) + (try.lifted io.monad) + (: (IO (Try Bit)))) + _ (if existing_class? + (in []) + (loader.store class_name class_bytecode library))] + (loader.load class_name loader)))) (def: (define! library loader context custom valueI) (-> Library java/lang/ClassLoader generation.Context (Maybe Text) Inst (Try [Text Any Definition])) @@ -175,11 +175,11 @@ [(..class_name context) bytecode]) (def: (re_learn context custom [_ bytecode]) - (io.run + (io.run! (loader.store (maybe.else (..class_name context) custom) bytecode library))) (def: (re_load context custom [directive_name bytecode]) - (io.run + (io.run! (do (try.with io.monad) [.let [class_name (maybe.else (..class_name context) custom)] -- cgit v1.2.3