diff options
author | Eduardo Julian | 2015-03-18 08:50:27 -0400 |
---|---|---|
committer | Eduardo Julian | 2015-03-18 08:50:27 -0400 |
commit | 9a037df75e0d06afb5f26b4c4222009bbfc2c9e6 (patch) | |
tree | 49c18c75e56e10430c99532ef49ecf08a109ae75 /src/lux/analyser/base.clj | |
parent | 17c482dcbd49294a8d6e995ab6878445330b216c (diff) |
[2nd Super Refactoring That Breaks The System: Part 4]
- Finished moving the codebase to use the functions from lux.base with the "&" prefix.
Diffstat (limited to 'src/lux/analyser/base.clj')
-rw-r--r-- | src/lux/analyser/base.clj | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/lux/analyser/base.clj b/src/lux/analyser/base.clj index b2ec4d0c5..256acd346 100644 --- a/src/lux/analyser/base.clj +++ b/src/lux/analyser/base.clj @@ -1,9 +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 - try-all-m map-m mapcat-m reduce-m - assert!]] + (lux [base :as & :refer [exec return fail]] [type :as &type]))) ;; [Resources] @@ -19,16 +17,16 @@ (defn analyse-1 [analyse elem] (exec [output (analyse elem)] (matchv ::M/objects [output] - ["Cons" [x ["Nil" _]]] + [["Cons" [x ["Nil" _]]]] (return x) [_] (fail "[Analyser Error] Can't expand to other than 1 element.")))) (defn analyse-2 [analyse el1 el2] - (exec [output (mapcat-m analyse (list el1 el2))] - (match output - ["Cons" [x ["Cons" [y ["Nil" _]]]]] + (exec [output (&/flat-map analyse (list el1 el2))] + (matchv ::M/objects [output] + [["Cons" [x ["Cons" [y ["Nil" _]]]]]] (return [x y]) [_] |