janus
unread,Nov 18, 2010, 10:52:04 AM11/18/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
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.