aboutsummaryrefslogtreecommitdiff
path: root/luxc
diff options
context:
space:
mode:
Diffstat (limited to 'luxc')
-rw-r--r--luxc/src/lux/analyser/jvm.clj7
-rw-r--r--luxc/src/lux/base.clj10
-rw-r--r--luxc/src/lux/compiler/jvm.clj2
3 files changed, 9 insertions, 10 deletions
diff --git a/luxc/src/lux/analyser/jvm.clj b/luxc/src/lux/analyser/jvm.clj
index 24d2b2017..5ea64d41a 100644
--- a/luxc/src/lux/analyser/jvm.clj
+++ b/luxc/src/lux/analyser/jvm.clj
@@ -25,7 +25,6 @@
(fn [state]
(|let [exceptions (&/|map #(Class/forName % true class-loader) exceptions*)
catching (->> state
- (&/get$ &/$host)
(&/get$ &/$catching)
(&/|map #(Class/forName % true class-loader)))]
(if-let [missing-ex (&/fold (fn [prev ^Class now]
@@ -53,14 +52,14 @@
(defn ^:private with-catches [catches body]
"(All [a] (-> (List Text) (Lux a) (Lux a)))"
(fn [state]
- (let [old-catches (->> state (&/get$ &/$host) (&/get$ &/$catching))
- state* (->> state (&/update$ &/$host #(&/update$ &/$catching (partial &/|++ catches) %)))]
+ (let [old-catches (&/get$ &/$catching state)
+ state* (&/update$ &/$catching (partial &/|++ catches) state)]
(|case (&/run-state body state*)
(&/$Left msg)
(&/$Left msg)
(&/$Right state** output)
- (&/$Right (&/T [(->> state** (&/update$ &/$host #(&/set$ &/$catching old-catches %)))
+ (&/$Right (&/T [(&/set$ &/$catching old-catches state**)
output]))))
))
diff --git a/luxc/src/lux/base.clj b/luxc/src/lux/base.clj
index 5e8c8c0d0..6ab09166e 100644
--- a/luxc/src/lux/base.clj
+++ b/luxc/src/lux/base.clj
@@ -117,7 +117,6 @@
["writer"
"loader"
"classes"
- "catching"
"type-env"
"dummy-mappings"
])
@@ -143,6 +142,7 @@
"expected"
"seed"
"scope-type-vars"
+ "catching"
"host"])
;; Compiler
@@ -716,10 +716,10 @@
(defn with-no-catches [body]
"(All [a] (-> (Lux a) (Lux a)))"
(fn [state]
- (let [old-catching (->> state (get$ $host) (get$ $catching))]
- (|case (body (update$ $host #(set$ $catching $Nil %) state))
+ (let [old-catching (->> state (get$ $catching))]
+ (|case (body (set$ $catching $Nil state))
($Right state* output)
- (return* (update$ $host #(set$ $catching old-catching %) state*) output)
+ (return* (set$ $catching old-catching state*) output)
($Left msg)
(fail* msg)))))
@@ -750,6 +750,8 @@
0
;; scope-type-vars
$Nil
+ ;; catching
+ $Nil
;; "lux;host"
host-data]
))
diff --git a/luxc/src/lux/compiler/jvm.clj b/luxc/src/lux/compiler/jvm.clj
index bb333df57..809c03022 100644
--- a/luxc/src/lux/compiler/jvm.clj
+++ b/luxc/src/lux/compiler/jvm.clj
@@ -232,8 +232,6 @@
(memory-class-loader store)
;; "lux;classes"
store
- ;; "lux;catching"
- &/$Nil
;; "lux;module-states"
(&/|table)
;; lux;type-env