Re: using partial with ->

2013-06-07 Thread Алексей Александров
Because (partial map first) return function => (-> [[1 2] [3 4] [5]] (partial map first)) # you should call function to get result => (-> [[1 2] [3 4] [5]] ((partial map first)) flatten) (1 3 5) 2013/6/8 Matt Smith > Newbie question here. This code: > > (println (flatten(map first '([1 2] [3

Re: using partial with ->

2013-06-07 Thread Matt Smith
Got it. Thanks! On Friday, June 7, 2013 3:29:55 PM UTC-6, Jonathan Fischer Friberg wrote: > > On Fri, Jun 7, 2013 at 11:13 PM, Matt Smith > > wrote: > >> (-> '([1 2] [3 4] [5]) >> (partial map first) >> flatten >> ) > > > Because this becomes > > (flatten (partial '([1 2] [3 4] [5]

Re: using partial with ->

2013-06-07 Thread Neale Swinnerton
On Fri, Jun 7, 2013 at 10:13 PM, Matt Smith wrote: > (println > (-> '([1 2] [3 4] [5]) > (partial map first) > flatten > )) > > when expanded becomes this: (println (flatten (partial '([1 2] [3 4] [5]) map first))) It looks like what you really want is to drop the partial a

Re: using partial with ->

2013-06-07 Thread Jonathan Fischer Friberg
On Fri, Jun 7, 2013 at 11:13 PM, Matt Smith wrote: > (-> '([1 2] [3 4] [5]) > (partial map first) > flatten > ) Because this becomes (flatten (partial '([1 2] [3 4] [5]) map first)) I think I understand how you thought; "(partial map first) becomes a function, then I call this

using partial with ->

2013-06-07 Thread Matt Smith
Newbie question here. This code: (println (flatten(map first '([1 2] [3 4] [5] (def mapfirst (partial map first)) (println (-> '([1 2] [3 4] [5]) mapfirst flatten )) (println (-> '([1 2] [3 4] [5]) (partial map first) flatten )) prints out: > (1 3 5