diff options
author | Eduardo Julian | 2020-08-10 02:29:18 -0400 |
---|---|---|
committer | Eduardo Julian | 2020-08-10 02:29:18 -0400 |
commit | 56fa0ab84c1112ea297c46814e580ca8d11b101e (patch) | |
tree | f6a4eeb3032ef86ab916c69b0a2de7865ffb087b /lux-js/source | |
parent | f79e39de3f605695a33acadf751be498f552930b (diff) |
Improved naming when evaluating code on the host platform.
Diffstat (limited to 'lux-js/source')
-rw-r--r-- | lux-js/source/program.lux | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux index 3232e6c82..f75a78c97 100644 --- a/lux-js/source/program.lux +++ b/lux-js/source/program.lux @@ -433,7 +433,7 @@ (for {@.old (as-is (def: (evaluate! interpreter alias input) - (-> javax/script/ScriptEngine Text _.Expression (Try Any)) + (-> javax/script/ScriptEngine Context _.Expression (Try Any)) (do try.monad [?output (javax/script/ScriptEngine::eval (_.code input) interpreter)] (case ?output @@ -443,8 +443,8 @@ #.None (exception.throw ..null-has-no-lux-representation [(#.Some input)])))) - (def: (execute! interpreter alias input) - (-> javax/script/ScriptEngine Text _.Statement (Try Any)) + (def: (execute! interpreter input) + (-> javax/script/ScriptEngine _.Statement (Try Any)) (do try.monad [?output (javax/script/ScriptEngine::eval (_.code input) interpreter)] (wrap []))) @@ -455,8 +455,8 @@ @global (_.var global)] (do try.monad [#let [definition (_.define @global input)] - _ (execute! interpreter global definition) - value (evaluate! interpreter global @global)] + _ (execute! interpreter definition) + value (evaluate! interpreter context @global)] (wrap [global value definition])))) (def: host @@ -473,12 +473,12 @@ (|> content encoding.from-utf8 try.assume (:coerce _.Statement))) (def: (re-learn context content) - (..execute! interpreter (reference.artifact context) content)) + (..execute! interpreter content)) (def: (re-load context content) (do try.monad - [_ (..execute! interpreter "" content)] - (..evaluate! interpreter "" (_.var (reference.artifact context)))))))))) + [_ (..execute! interpreter content)] + (..evaluate! interpreter context (_.var (reference.artifact context)))))))))) ) @.js @@ -493,7 +493,7 @@ (#.Some return)))) (def: (evaluate! alias input) - (-> Text _.Expression (Try Any)) + (-> Context _.Expression (Try Any)) (do try.monad [?output (host.try (..eval (_.code input)))] (case ?output @@ -503,8 +503,8 @@ #.None (exception.throw ..null-has-no-lux-representation [(#.Some input)])))) - (def: (execute! alias input) - (-> Text _.Statement (Try Any)) + (def: (execute! input) + (-> _.Statement (Try Any)) (do try.monad [?output (host.try (..eval (_.code input)))] (wrap []))) @@ -515,8 +515,8 @@ @global (_.var global)] (do try.monad [#let [definition (_.define @global input)] - _ (..execute! global definition) - value (..evaluate! global @global)] + _ (..execute! definition) + value (..evaluate! context @global)] (wrap [global value definition])))) (def: host @@ -531,12 +531,12 @@ (|> content encoding.from-utf8 try.assume (:coerce _.Statement))) (def: (re-learn context content) - (..execute! (reference.artifact context) content)) + (..execute! content)) (def: (re-load context content) (do try.monad - [_ (..execute! "" content)] - (..evaluate! "" (_.var (reference.artifact context))))))))) + [_ (..execute! content)] + (..evaluate! context (_.var (reference.artifact context))))))))) )}) (def: platform |