I tried to run Jame's code, but the compiler (1.2 beta) squawked at me:
Unable to resolve symbol: indexed in this context
  [Thrown class java.lang.Exception]

What do I need to pull in to pick up the "indexed" function?

On Sat, Jul 17, 2010 at 5:08 AM, James Reeves <jree...@weavejester.com> wrote:
> Perhaps something like this?
>
> (defn convolve [ns ms]
>  (loop [nums (for [[i n] (indexed ns)
>                    [j m] (indexed ms)] [(+ i j) (+ n m)])
>         y    (transient (vec (repeat (+ (count ns) (count ms)) 0)))]
>    (if-let [[i s] (first nums)]
>      (recur (next nums) (assoc! y i (+ (y i) s)))
>      (persistent! y))))

-- 
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