jarohen / chord

A library designed to bridge the gap between the triad of CLJ/CLJS, web-sockets and core.async.
439 stars 40 forks source link

with-channel without options doesn't work in 0.4.1 #18

Closed weavejester closed 10 years ago

weavejester commented 10 years ago

There's a problem with the with-channel logic, specifically on lines 59 to 61:

        opts (when opts? opts)
        body (cond->> body
               (not opts?) (cons opts))

If opts? is false, then opts is bound to nil, and body is bound to (cons nil body).

To fix this, the opts rebinding should come after the body rebinding.

jarohen commented 10 years ago

Thanks James - I'll incorporate your fix when I get a moment. Failing that, if you've got a fork, could you submit a PR?

Cheers,

James

weavejester commented 10 years ago

PR submitted (#19).

jarohen commented 10 years ago

Fixed in #19 (deployed as 0.4.2), thanks!