Hi, Am 21.07.2009 um 22:48 schrieb Jimmie Houchin:
(defn is-small? [number] (if (< number 100) "yes" "no" )) Is is-small? a predicate? If so, is this a common pattern for such predicates?
The definition is correct. is-small? is not a predicate. It returns a string. So (if (is-small? x) ..) is always true! I suspect that the string produced by is-small? is used somewhere. (defn is-small? [number] (< number 100)) This would be a predicate since it returns a Boolean. Hope this helps. Sincerely Meikel
smime.p7s
Description: S/MIME cryptographic signature