diff options
author | Eduardo Julian | 2015-05-06 17:46:08 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-05-06 17:46:08 -0400 |
commit | 2560b63dcc98a6a6b5e2f938d8279d9bb4627052 (patch) | |
tree | 07d1c96d72f36317c1e6f558984c981fee013787 /src/lux/analyser/module.clj | |
parent | 2aca948eddd42300a936fd449b8ab77333d95146 (diff) |
- Removed all the unnecesary comments.
- Made some changes to the way type-checking is performed on variants, records & tuples in order to improve the speed of type-checking.
Diffstat (limited to 'src/lux/analyser/module.clj')
-rw-r--r-- | src/lux/analyser/module.clj | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/lux/analyser/module.clj b/src/lux/analyser/module.clj index de68f48aa..5960d3080 100644 --- a/src/lux/analyser/module.clj +++ b/src/lux/analyser/module.clj @@ -32,7 +32,6 @@ (defn def-alias [a-module a-name r-module r-name type] (fn [state] - ;; (prn 'def-alias [a-module a-name] '=> [r-module r-name]) (matchv ::M/objects [(&/get$ &/$ENVS state)] [["lux;Cons" [?env ["lux;Nil" _]]]] (return* (->> state @@ -53,7 +52,6 @@ (defn exists? [name] (fn [state] - ;; (prn `exists? name (->> state (&/get$ &/$MODULES) (&/|contains? name))) (return* state (->> state (&/get$ &/$MODULES) (&/|contains? name))))) @@ -96,20 +94,19 @@ (if-let [$def (&/|get name $module)] (matchv ::M/objects [$def] [[exported? ["lux;ValueD" ?type]]] - (do ;; (prn 'declare-macro/?type (aget ?type 0)) - (&/run-state (|do [_ (&type/check &type/Macro ?type) - ^ClassLoader loader &/loader - :let [macro (-> (.loadClass loader (&host/location (&/|list module name))) - (.getField "_datum") - (.get nil))]] - (fn [state*] - (return* (&/update$ &/$MODULES - (fn [$modules] - (&/|put module (&/|put name (&/T exported? (&/V "lux;MacroD" macro)) $module) - $modules)) - state*) - nil))) - state)) + (&/run-state (|do [_ (&type/check &type/Macro ?type) + ^ClassLoader loader &/loader + :let [macro (-> (.loadClass loader (&host/location (&/|list module name))) + (.getField "_datum") + (.get nil))]] + (fn [state*] + (return* (&/update$ &/$MODULES + (fn [$modules] + (&/|put module (&/|put name (&/T exported? (&/V "lux;MacroD" macro)) $module) + $modules)) + state*) + nil))) + state) [[_ ["lux;MacroD" _]]] (fail* (str "[Analyser Error] Can't re-declare a macro: " (str module &/+name-separator+ name))) |