diff options
author | Eduardo Julian | 2023-01-18 01:38:48 -0400 |
---|---|---|
committer | Eduardo Julian | 2023-01-18 01:38:48 -0400 |
commit | 670438b982bbe0b662b0a65958dc4f8b289d3906 (patch) | |
tree | 390ddabf9c802c1f38d4fd985b7e29677cb0ac66 /lux-js/source | |
parent | dfe09eb7a90dbf164bc0c78085b2d340e0928190 (diff) |
More efficient "let" and "exec" expressions.
Diffstat (limited to '')
-rw-r--r-- | lux-js/source/program.lux | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/lux-js/source/program.lux b/lux-js/source/program.lux index f896219f8..7bc4dd036 100644 --- a/lux-js/source/program.lux +++ b/lux-js/source/program.lux @@ -34,14 +34,14 @@ ["[0]" file] ["[0]" environment]] [meta - ["@" target (.only) - ["_" js]] [macro ["^" pattern] ["[0]" template]] [compiler [reference [variable (.only Register)]] + ["@" target (.only) + ["_" js]] [language [lux [program (.only Program)] @@ -519,8 +519,8 @@ ) (for @.jvm - (these (def (evaluate! interpreter alias input) - (-> javax/script/ScriptEngine unit.ID _.Expression (Try Any)) + (these (def (evaluate! interpreter input) + (-> javax/script/ScriptEngine _.Expression (Try Any)) (do try.monad [?output (javax/script/ScriptEngine::eval (ffi.as_string (_.code input)) interpreter)] (when ?output @@ -544,7 +544,7 @@ (do try.monad [.let [definition (_.define @global input)] _ (execute! interpreter definition) - value (evaluate! interpreter context @global)] + value (evaluate! interpreter @global)] (in [global value definition])))) (def host @@ -553,7 +553,7 @@ (org/openjdk/nashorn/api/scripting/NashornScriptEngineFactory::new))] (is (Host _.Expression _.Statement) (implementation - (def (evaluate alias [_ input]) (..evaluate! interpreter alias input)) + (def (evaluate [_ input]) (..evaluate! interpreter input)) (def execute (..execute! interpreter)) (def (define context custom [_ input]) (..define! interpreter context custom input)) @@ -566,7 +566,7 @@ (def (re_load context custom content) (do try.monad [_ (..execute! interpreter content)] - (..evaluate! interpreter context (_.var (reference.artifact context)))))))))) + (..evaluate! interpreter (_.var (reference.artifact context)))))))))) ) @.js @@ -580,8 +580,8 @@ {.#None} {.#Some return})))) - (def (evaluate! alias input) - (-> unit.ID _.Expression (Try Any)) + (def (evaluate! input) + (-> _.Expression (Try Any)) (do try.monad [?output (..eval (_.code input))] (when ?output @@ -605,14 +605,14 @@ (do try.monad [.let [definition (_.define @global input)] _ (..execute! definition) - value (..evaluate! context @global)] + value (..evaluate! @global)] (in [global value definition])))) (def host (IO (Host _.Expression _.Statement)) (io (is (Host _.Expression _.Statement) (implementation - (def (evaluate alias [_ input]) (..evaluate! alias input)) + (def (evaluate [_ input]) (..evaluate! input)) (def execute ..execute!) (def (define context custom [_ input]) (..define! context custom input)) @@ -625,7 +625,7 @@ (def (re_load context custom content) (do try.monad [_ (..execute! content)] - (..evaluate! context (_.var (reference.artifact context))))))))) + (..evaluate! (_.var (reference.artifact context))))))))) )) (def phase_wrapper |