From 56fa0ab84c1112ea297c46814e580ca8d11b101e Mon Sep 17 00:00:00 2001 From: Eduardo Julian Date: Mon, 10 Aug 2020 02:29:18 -0400 Subject: Improved naming when evaluating code on the host platform. --- lux-jvm/source/luxc/lang/translation/jvm.lux | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 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 cebd5e652..0ffea0e42 100644 --- a/lux-jvm/source/luxc/lang/translation/jvm.lux +++ b/lux-jvm/source/luxc/lang/translation/jvm.lux @@ -104,9 +104,10 @@ ..class-path-separator (%.nat module-id) ..class-path-separator (%.nat artifact-id))) -(def: (evaluate! library loader eval-class valueI) - (-> Library java/lang/ClassLoader Text Inst (Try [Any Definition])) - (let [bytecode-name (..bytecode-name eval-class) +(def: (evaluate! library loader context valueI) + (-> Library java/lang/ClassLoader generation.Context Inst (Try [Any Definition])) + (let [eval-class (..class-name context) + bytecode-name (..bytecode-name eval-class) bytecode (def.class #jvm.V1_6 #jvm.Public jvm.noneC bytecode-name @@ -127,8 +128,8 @@ (wrap [value [eval-class bytecode]]))))) -(def: (execute! library loader temp-label [class-name class-bytecode]) - (-> Library java/lang/ClassLoader Text Definition (Try Any)) +(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 (dictionary.contains? class-name)) @@ -141,10 +142,9 @@ (def: (define! library loader context valueI) (-> Library java/lang/ClassLoader generation.Context Inst (Try [Text Any Definition])) - (let [class-name (..class-name context)] - (do try.monad - [[value definition] (evaluate! library loader class-name valueI)] - (wrap [class-name value definition])))) + (do try.monad + [[value definition] (evaluate! library loader context valueI)] + (wrap [(..class-name context) value definition]))) (def: #export host (IO Host) @@ -152,9 +152,9 @@ loader (loader.memory library)] (: Host (structure - (def: (evaluate! temp-label valueI) + (def: (evaluate! context valueI) (:: try.monad map product.left - (..evaluate! library loader (text.replace-all " " "$" temp-label) valueI))) + (..evaluate! library loader context valueI))) (def: execute! (..execute! library loader)) -- cgit v1.2.3