このエラーが発生し続けますが、解決できないようです。
(ns stack)
(def output [[1, 2 ,3]])
(def condensedrecords 0)
(def i 0)
(def currentDateTime 0)
(def timeDiffinSeconds 0)
(def secondLastOutputValue 0)
(def outlier [])
(def isOutlier false)
(def timeDiffinSeconds 20)
(def for1 true)
(def ab [1])
;just for testing
(def a [1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30])
(def b [a, a])
(def NoOfLines 3)
(defn getOutlierConfidence [p i]
0.5)
(defn processNewTransaction [p i] 1)
(defn exceedTimeThresholdwDistance [p i] false)
(defn doRunThroughSplit [vector]
(loop [i 1
condensed 0
output1 output
outlier1 outlier]
(if (< i (- NoOfLines 1))
(let [p ((peek output1) 1)] ;function doesnt work
(cond
;cond1
(= ((vector i) 27) ((peek output1) 1)) (do(let [condensed (inc condensed)]
(println "in cond1")
(recur (inc i) condensed output1 outlier1)))
;cond2
(> timeDiffinSeconds 480) (do (let [i (processNewTransaction p i)] (println "in cond2") (recur (inc i) condensed output1 outlier1)))
;cond3
(> timeDiffinSeconds 600) (do (let [i (processNewTransaction p i)] (println "in cond3") (recur (inc i) condensed output1 outlier1)))
;cond4
(exceedTimeThresholdwDistance p i) (do (let [i (processNewTransaction p i)] (println "in cond4") (recur (inc i) condensed output1 outlier1)))
(and (not= ((peek output) 1) ((vector i) 27)) (not= secondLastOutputValue ((vector i) 27)))
(do ;perform the following statements
(println "in cond5")
(let [secondLastOutputValue ((peek vector) 27)]
***output1 (conj ([output1] ab))]*** ;error starts at here/// ab is a vector by commenting this line the error is removed
(println "reached")
(recur (inc i) condensed output1 outlier1)))
);cond ending
);let ending
[condensed, output1, outlier1]);if ending
);loop ending
);func ending
(def sa (doRunThroughSplit b))
行output1(conj([output1] ab))であるエラーはコメント化されていますが、 このエラーをまったく解決できないようです。コードの大部分は問題ないように見えますが、cond5のletステートメントにヒットすると、エラーが発生します。
出力は次のようになります
cond5で///ここで終了