aboutsummaryrefslogtreecommitdiff
path: root/src/lux/analyser/base.clj
diff options
context:
space:
mode:
authorEduardo Julian2015-04-08 20:27:38 -0400
committerEduardo Julian2015-04-08 20:27:38 -0400
commit36ba345de7e20ad1a51f5ab05ce10931dba04771 (patch)
treebc0be40430491f02a59a65b59fb2d0a6e852c575 /src/lux/analyser/base.clj
parent0826f2b9780591b53ff1faa33bf413f05e8bdbc9 (diff)
- Renamed exec to |do.
- :let within |do now uses |let instead of let. - The analyser now does totality analysis and structures the pattern matching, with the compiler only compiling the generated structures. - Local bindings with case' can now be prefixed arbitrarily. (Note: must do the same with functions).
Diffstat (limited to 'src/lux/analyser/base.clj')
-rw-r--r--src/lux/analyser/base.clj10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lux/analyser/base.clj b/src/lux/analyser/base.clj
index 62ccedb51..b287b545f 100644
--- a/src/lux/analyser/base.clj
+++ b/src/lux/analyser/base.clj
@@ -1,7 +1,7 @@
(ns lux.analyser.base
(:require [clojure.core.match :as M :refer [match matchv]]
clojure.core.match.array
- (lux [base :as & :refer [exec return fail]]
+ (lux [base :as & :refer [|do return fail]]
[type :as &type])))
;; [Resources]
@@ -17,7 +17,7 @@
(fail (str "[Analyser Error] Can't retrieve the type of a statement: " (pr-str syntax+)))))
(defn analyse-1 [analyse exo-type elem]
- (exec [output (analyse exo-type elem)]
+ (|do [output (analyse exo-type elem)]
(do ;; (prn 'analyse-1 (aget output 0))
(matchv ::M/objects [output]
[["lux;Cons" [x ["lux;Nil" _]]]]
@@ -27,7 +27,7 @@
(fail "[Analyser Error] Can't expand to other than 1 element.")))))
(defn analyse-2 [analyse el1 el2]
- (exec [output (&/flat-map% analyse (&/|list el1 el2))]
+ (|do [output (&/flat-map% analyse (&/|list el1 el2))]
(do ;; (prn 'analyse-2 (aget output 0))
(matchv ::M/objects [output]
[["lux;Cons" [x ["lux;Cons" [y ["lux;Nil" _]]]]]]
@@ -37,9 +37,9 @@
(fail "[Analyser Error] Can't expand to other than 2 elements.")))))
(defn with-var [k]
- (exec [=var &type/fresh-var
+ (|do [=var &type/fresh-var
=ret (k =var)]
(matchv ::M/objects [=ret]
[["Expression" [?expr ?type]]]
- (exec [=type (&type/clean =var ?type)]
+ (|do [=type (&type/clean =var ?type)]
(return (&/V "Expression" (&/T ?expr =type)))))))