The snippet I provided, is an idiomatic Clojure ?
On Friday, November 16, 2012 12:41:31 AM UTC+2, Jay Fields wrote:
>
> 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]<javascript:>>
> 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]<javascript:>
> > 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] <javascript:>
> > 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