Detect constants.

This commit is contained in:
Chris Ford 2014-04-02 20:39:08 +01:00
parent f65185b963
commit bf29efecb3

View file

@ -5,5 +5,13 @@
(list 'is (list '= (list fnname arg) (eval (list fnname arg))))
(catch Exception e (list 'is (list 'thrown? (.getClass e) (list fnname arg))))))
(defn testgen [fndef] nil)
(defn is-constant? [x] (not (symbol? x)))
(defn constants [form]
(filter is-constant? (flatten form)))
(comment
(constants '(fn is-four [x] (= 88 [44])))
)