I am reading your site

10 views
Skip to first unread message

janus

unread,
Nov 18, 2010, 10:52:04 AM11/18/10
to Clojure Games
Hello ,

(defn radius [x]
(if (number? (:radius x))
(:radius x)
((:radius x))))

(defn position [x]
(if (sequential? (:position x))
(:position x)
((:position x))))

Could you tell me what you wanted to achieve with the above? It looks
awkward , and why the double parens for the false statement(did you
test the "falsety" of those functions. To me you have not done beyond
that (:radius x) cannot do.

May be you wanted something like (and (number? (:radius x)) (radius
x)) . I am a bit lost why you code was structured that way.

Regards,
Emeka.

I have been away from Clojure for some time now, so I may be rusty.
Reply all
Reply to author
Forward
0 new messages