>
> So, if a list whose first element is a vector is provided after a get or a
> put in alt!, then that's treated as the binding form/code to be executed if
> that succeeds, but if a non-list is provided, then that is treated as a
> value to return if that action was taken (and that value is ev
So, if a list whose first element is a vector is provided after a get or a
put in alt!, then that's treated as the binding form/code to be executed if
that succeeds, but if a non-list is provided, then that is treated as a
value to return if that action was taken (and that value is evaluated
be
On Thu Aug 14 19:04 2014, dgrnbrg wrote:
> You're all right--that was a cut & paste error. I meant that I see this
> behavior with alt!!, not alts!
With alt!!, it should probably be something like:
(let [result (alt!! [[inner-chan e]] ([v] (if v
:put-a
You're all right--that was a cut & paste error. I meant that I see this
behavior with alt!!, not alts!
On Thursday, August 14, 2014 3:31:45 PM UTC-4, Ghadi Shayban wrote:
>
> What Daniel said. The call is incorrect, its args are alt-shaped, but it
> calls alt*s*.
>
> alt is the macro that is sh
What Daniel said. The call is incorrect, its args are alt-shaped, but it
calls alt*s*.
alt is the macro that is shaped like cond.
alts is the function that takes a vector
Both take splatted options at the end.
Can never use single bang* except within go.*
go => !
thread => !!
Unfortunately i
Hi there,
The :default option is for a *value* that should be returned if none of the
channels are available. The expression is evaluated *before* the
async/alts! call happens (just like normal parameters).
I think you are misunderstanding alts!. It should be used like this
(let [[val ch] (asy
Hello,
I was just wondering if you are using the right function. Without
actually trying to run any code, a couple of things pop into mind:
1. alts! can only be used in a go macro.
2. The invocation doesn't look right for alts!.
Perhaps you want something like:
(let [[val port] (async/alts!! [
When I use alts!, it seems that both the put and :default action run every
time. I've included the code sample below:
(let [inner-chan (async/chan (async/buffer 1000))
mult (async/mult inner-chan)
(async/thread
(while true
(let [e (.take linked-blocking-queue)]
(async/al