Clojure Defn returning empty parentheses just after displaying correct answer

137 Views Asked by At

I am trying to get only one zodiac name to past it down to different function, but I don not know why I ma getting empty parentheses after displayed zodiac. I am newbie with Clojure.

(defn miko []
                        (let [guess (read)]  
                        (remove nil?(cond 

                             (some #(= guess %) (range 101 120))(println "Capricorn")
                             (some #(= guess %) (range 120 219))(println "Aquarius")
                             (some #(= guess %) (range 219 321))(print "Pisces")
                             (some #(= guess %) (range 321 420))(print "Aries")
                             (some #(= guess %) (range 420 521))(print "Taurus")
                             (some #(= guess %) (range 521 621))(print "Gemini")
                             (some #(= guess %) (range 621 723))(print "Cancer")
                             (some #(= guess %) (range 723 823))(print "Leo")
                             (some #(= guess %) (range 823 923))(print "Virgo")
                             (some #(= guess %) (range 923 1023))(print "Libra")
                             (some #(= guess %) (range 1023 1122))(print "Scorpio")
                             (some #(= guess %) (range 1122 1221))(print "Sagittarius")
                             (some #(= guess %) (range 1221 3112))(print "Capricorn")
                             :else "wrong"))))

I run it (miko) and this is the result:

Capricorn

()

Please help me to remove this , because when I want to pass down the result name for example Capricorn to another function, it passes down ()-parentheses instead.

1

There are 1 best solutions below

6
On BEST ANSWER

You're doing all right, just remove the print statements, for example replace (print "Capricorn") with "Capricorn", and the function will work.

You also don't need the (remove nil? ...)