Why the use of map? function ?
I don't get it.

On Friday, November 16, 2012 8:08:40 AM UTC+2, lpetit wrote:
>
> (map #(seq (process-some-class-instance %))
>        (tree-seq map? :children input))
>
> Sent from a smartphone, please excuse the brevity/typos.
>
> Le 16 nov. 2012 à 00:13, "Hussein B." <hubag...@gmail.com <javascript:>> 
> a écrit :
>
> Yes true.
>
> If it is leaf , do process-some-class-instance
>
> If it is not, then it could hold a collection of nodes and leafs (a 
> mixture)
>
> Actually , I'm checking tree-seq but I don't know how to use it in my case.
>
> Any ideas ?
>
> On Friday, November 16, 2012 1:06:22 AM UTC+2, lpetit wrote:
>>
>> Am I right in guessing that your input is some kind of tree where 
>> Someclass instances are leafs and non-leaf nodes are represented by maps 
>> having a :children key?
>>
>> Sent from a smartphone, please excuse the brevity/typos.
>>
>> Le 15 nov. 2012 à 23:33, "Hussein B." <hubag...@gmail.com> a écrit :
>>
>> 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 clo...@googlegroups.com
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com
>> 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 clo...@googlegroups.com <javascript:>
> Note that posts from new members are moderated - please be patient with 
> your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com <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 clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to