That code is clear enough that I wouldn't feel obligated to change it
if I encountered it.

You could also

(defmulti crazy class)

(defmethod crazy SomeClass [input]
  (seq (process-some-class-instance input))

(defmethod crazy :default [{:keys [children]}]
  (map crazy children))

On Thu, Nov 15, 2012 at 5:33 PM, Hussein B. <[email protected]> wrote:
> Hi,
>
> Would you please help me to morph this to an idiomatic Clojure ?
>
> (defn crazy [input]
>     (if (instance? SomeClass input)
>         (seq (process-some-class-instance input))
>         (map  crazy  (:children input))))
>
>
> Thanks for help and time.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to