Re: Help with closures

2009-10-09 Thread Mark Tomko
Of course. I'm not sure what I was thinking. Thank you. On Oct 9, 7:47 pm, Shawn Hoover wrote: > On Fri, Oct 9, 2009 at 10:37 PM, Mark Tomko wrote: > > ; a returns a new similarity function that applies the provided > > transform function > > ; before comparing a pair of collections > > (defn

Re: Help with closures

2009-10-09 Thread Shawn Hoover
On Fri, Oct 9, 2009 at 10:37 PM, Mark Tomko wrote: > ; a returns a new similarity function that applies the provided > transform function > ; before comparing a pair of collections > (defn make-coll-similarity-fn [coll-transform] > (fn [coll1 coll2] coll-similarity [coll1 coll2 coll-transform]))

Help with closures

2009-10-09 Thread Mark Tomko
Okay, I'm flummoxed. Given the following definition: (defn make-n-gram-fn [n] (fn [coll] (map vec (partition n 1 coll I can do this: (def bi-gram (make-n-gram-fn 2)) (bi-gram "abc") ([\a \b] [\b \c]) But, if I add the following: ; counts the number of indexes in a pair of collections