1
(defn GetValuesFromWhereCommand
"return a list of values from Where command"
[Query tableName]
(let [values (re-seq #"[0-9a-zA-Z_=<>]+" ((re-find #"WHERE(.*)" Query) 1))
bitwise (re-find #"AND|OR" Query)
tempList (ref #{})
]
; first loop will look for the operators = < >
(doseq [item values]
(let [result (case (re-find #"[=><]" item)
"=" (GetRowsfromCondition tableName item =)
"<" (GetRowsfromCondition tableName item <)
">" (GetRowsfromCondition tableName item >)
nil (println "nothing")
)]
(when (not= nil result) (dosync (alter tempList conj result)))
tempList)
)
(println tempList)
tempList) ; get the Where from Update ','
)
voici ma sortie.Clojure ET/OU des ensembles
#<[email protected]: #{#<[email protected]: #{0}> #<[email protected]: #{0 1}>}>
je voudrais faire mettre en œuvre et le fonctionnement qui sera de retour # {0}
et OR qui renverra # {0 1}.
mon problème est de savoir comment accéder aux listes que j'ai créées. Je n'ai pas pu utiliser union/intersection pour une raison quelconque.