--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clo...@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/f67cfcd0-8e1e-4780-bc00-f6993979e7afn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY3BWybiXzgoYaKK958z%2BWqTKf0o_5p9fq-huwutco9onw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fywhEidRkLx8DytqEs5wtXOaFtULCkBWgW%2BRVpmSfQvjg%40mail.gmail.com.
--You received this message because you are subscribed to the GoogleGroups "Clojure" group.To post to this group, send email to clo...@googlegroups.comNote that posts from new members are moderated - please be patient with your first post.To unsubscribe from this group, send email toFor more options, visit this group at---You received this message because you are subscribed to the Google Groups "Clojure" group.To unsubscribe from this group and stop receiving emails from it, send an email to clojure+u...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/f67cfcd0-8e1e-4780-bc00-f6993979e7afn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fywhEidRkLx8DytqEs5wtXOaFtULCkBWgW%2BRVpmSfQvjg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY1wAQiG3MNdBCLy-1TiRprduMN7rWDmYE0MRvZ%3D_spYjA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY3BWybiXzgoYaKK958z%2BWqTKf0o_5p9fq-huwutco9onw%40mail.gmail.com.
(every? eval members) does not appear to work on a list of functions designed to evaluate to a boolean.
That code is used in a function evaluateAndTwo simple tests(evaluateAnd [true true] --> true(evaluateAnd [true false] --> nil (why not "false" as the every? examples show?)
The specific code for building the list of functions is this(def x (atom []))
(let [result (list (ref SimpleTrue) (ref SimpleFalse))]
(println "BAL1" result )
(reset! x result)
)
(println "BAL2" @x )
(@x) <<<< returns the atom's valueAnd the final println is this
BAL2 (#object[clojure.lang.Ref 0x335b5620 {:status :ready, :val #object[ie4clj.Tests$SimpleTrue 0x6eb2384f ie4clj.Tests$SimpleTrue@6eb2384f]}] #object[clojure.lang.Ref 0x3c9c0d96 {:status :ready, :val #object[ie4clj.Tests$SimpleFalse 0x31dadd46 ie4clj.Tests$SimpleFalse@31dadd46]}])evaluateAnd never saw the result, with this error messageclojure.lang.PersistentList cannot be cast to clojure.lang.IFn
The test which fails is this
(def result (evaluateAnd (buildAndList) )) <<< fails here
(println "bar" result)
(result)The googleverse seems to agree that there are extra parens around the value. Google isn't giving me an obvious way to take that value outside of its surrounding parens (bal2 above).Still looking, and hoping that solves the problem.Maybe there's a way to go back to buildAndList and not return the value with parens.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fwv-rKrWnXji_r4scaX9_jtAi1CRUWGLLNRj7iZtme4UA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fwv-rKrWnXji_r4scaX9_jtAi1CRUWGLLNRj7iZtme4UA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY1wvo_N32dKV1g-9cZAmTbZUO5bRAXDGkdHm-7_VD_-Rg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fzjBE_F8%2BZ0fR69_1%3DWGs%3Duy5oJ3aGouYAmeQK9vRx6DA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CADBYUPta6ZJf1gWCFq0L236aOZm077YeRrVqOxnfov%2Bk%2BjcZuQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CADBYUPta6ZJf1gWCFq0L236aOZm077YeRrVqOxnfov%2Bk%2BjcZuQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY2EUs9Y3xHtnZM4HkjnnuQG0jvmvmRrY-uVkDENvj9AQA%40mail.gmail.com.
(defn simple-true [] true)
(defn simple-false [] false)
(defn not-simple-true [] (not simple-true))
(defn not-simple-false [] (not simple-false))
(defn simple-true [] '(true)) ;<--- notice the quote before the parenthesis(defn simple-true [] [true]) ; or just use vectors
ie4clj.core=> (true)
Execution error (ClassCastException) at ie4clj.core/eval1490 (form-init3173779095201492457.clj:1).
java.lang.Boolean cannot be cast to clojure.lang.IFn
ie4clj.core=> '(true)
(true)
(@x)
'(@x) ; <-- notice the quote
[@x] ; or use vector
@x
(defn build-and-list []
(println "BAL")
(let [result (flatten (list simple-true simple-false))] ;<-- actually not sure if this is the thing you want here. This will be a list of functions.
(println "BAL1" result )
result))
(defn first-test []
(println "First Test")
(let [x (evaluate-and [(constantly true) (constantly true)])
y (evaluate-and [(constantly true) (constantly false)])
l (build-and-list)
result (evaluate-and l)]
(println "A" x)
(println "B" y)
(println "C" l)
(println "bar" result)
result))
(defn evaluate-and
[members]
(println "EA" members)
(let [result (every? (fn [member] (member)) members)]
(println "EA+" result)
result)) ;<-- I added this line, as (println) one return nil, and I thought you needed the result true or false (?)
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fx6qEFtBP8Xbtq5aDYx-ujBydeLto3pxv%3Dq9O_Y6k5A3A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CADBYUPs5cFVjCtmzfBr8gwnOESKr07%2BXYEzMvcNewLnAoDO7rA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY1wvo_N32dKV1g-9cZAmTbZUO5bRAXDGkdHm-7_VD_-Rg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fyc%2BctV%2B1OgzWRYLsWevL97ouVkS1FGf0uGFtTcznRjUg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY0qvUUrTmQtfcUocwWbr50juXzoZt%3DSmPr%3D0o%3DgRXoM2A%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fxJXPC8Y%3DY_UEAsAyMek4FZwo%2BP9bVahzrVKQLKGd%3D3Lg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY3BKpWAu6%3D%2BEC6o3PSGg7CXETgyZymOBKLnhEJYG7UVdQ%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fz-Y9c9asSx85jrvrHvjLdX2qgLgjt8yPdxpHu_4X_vGg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY2fYJoAVPxngBiib41-2T%3DWsKL3QNQhw6%3DZe%2BpSKuPQKg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY2fYJoAVPxngBiib41-2T%3DWsKL3QNQhw6%3DZe%2BpSKuPQKg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fwFaouR1%2B0xAKzb-rc61WhTv-aant4Pn%3DMmYshjp-Bcmw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY2%3DQot1%3DYUrLSAY9Dp3%2BSYSTsu8Xbr1aY34yFDFhFA_hw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAH6s0fypDuf82H36-7ODPOSjc%2B%2BEH46WUDoYHhhAOjX3%2BpUNDA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/clojure/CAMZDCY0e60k0dXov-K0R0Oq1bQ-wN7bTugf%3D%3DMt%2BcFXS8wnayQ%40mail.gmail.com.