How can I take a large existing Java project and start to add Clojure modules? For example, in the code below, I'd like to make the following functions available in Java: state?, zip?, state-list, zipcode-list. The two predicates will return a boolean, but the "getters" will return arrays.
(def *states* (list "NJ" "NY" "CA")) (def *zipcodes* (list 12345 54343 98765)) (defn member [x sq] (if (seq sq) (if (= x (first sq)) sq (recur x (rest sq))))) (defn state? [aState] (not (= (member aState *states*) nil))) (defn zip? [aZip] (not (= (member aZip *zipcodes*) nil))) (defn state-list [] *states*) (defn zipcode-list [] *zipcodes*) ;; --------------- (state? "AA") (state? "CA") (zip? 11111) (zip? 12345)