aboutsummaryrefslogtreecommitdiff
path: root/lux-js
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--lux-js/source/program.lux32
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