I've confirmed this as a bug, it's a problem with functions inside the body
of a go when used along with an async op inside the body of a loop. Thanks
for the report, I've fixed it in master, and once we get a bit more
feedback, I'll create a new release. Should be out sometime in the next few
days.

Timothy


On Fri, Apr 25, 2014 at 11:45 AM, Charles Duffy <[email protected]> wrote:

> The most interesting thing I've learned from this release is just how
> lenient old releases were in the face of erroneous code, of which I appear
> to have had rather a lot. :)
>
> That said, I have found at least one behavior I'm not able to understand.
> This works perfectly with the new core.async:
>
> (defn apply-prefix-to-txn [prefix in-txn]
>   (vec (for [op in-txn] (assoc op 1 (vec (concat prefix (get op 1)))))))
>
> (defn apply-prefix
>   [in-chan prefix]
>   (map< (partial apply-prefix-to-txn prefix) in-chan))
>
> ...but the definition below (which is, certainly, much worse code) results
> in a compile-time error:
>
> (defn apply-prefix
>   [in-chan prefix]
>   (let [out-chan (chan)]
>     (go
>       (loop []
>         (when-let [in-txn (<! in-chan)]
>           (>! out-chan (vec (for [op in-txn] (assoc op 1 (vec (concat
> prefix (get op 1)))))))
>           (recur))))))
>
> ...that being:
>
> CompilerException java.lang.IllegalArgumentException: No method in
> multimethod '-item-to-ssa' for dispatch value: :fn,
> compiling:(/private/var/folders/hm/50_gxm6n4k3dbcqddkw3_btw0000gn/T/form-init2129308341681179922.clj:4:5)
>
> My expectation is that these should be equivalent. Is there something I'm
> missing here?
>
>>  --
> 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
> ---
> You received this message because you are subscribed to the Google Groups
> "Clojure" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 
“One of the main causes of the fall of the Roman Empire was that–lacking
zero–they had no way to indicate successful termination of their C
programs.”
(Robert Firth)

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to