Looking only at the futurize signature with {:keys [exec] :or {exec :mixed} :as opts}, I don't quite understand the effect:
@((flow/futurize #(* % %) {:exec :mixed}) 4) ;; 16
@((flow/futurize #(* % %)) 4) ;; (IllegalArgumentException) at clojure.core.async.impl.dispatch/create-default-executor (dispatch.clj:77)Which version of core.async are you using? That error doesn't seem to line up with alpha2.
it was indeed alpha 1 but after I changed it to 1.9.829-alpha2 the error is still there
because the options are after the &, these are varargs, so you don't put them in a map
In the error case it has no options tho'...?
or you're saying that without args it doesn't work
sorry, catching up
user=> (add-lib 'org.clojure/core.async)
[org.clojure/core.async org.clojure/core.cache org.clojure/core.memoize org.clojure/data.priority-map org.clojure/tools.analyzer org.clojure/tools.analyzer.jvm org.ow2.asm/asm]
user=> (require '[clojure.core.async.flow :as flow])
nil
user=> @((flow/futurize #(* % %)) 4)
Execution error (IllegalArgumentException) at clojure.core.async.impl.dispatch/create-default-executor (dispatch.clj:129).
No matching clause:yeah, this is a bug
Hmm, no, that's not quite it... `opts` is
Ah, nil when options are omitted, and it passes that to the impl fn without any default behavior.{:keys [exec] :or {exec :mixed} :as opts} provides a default for exec but opts is left as-is and passed into the impl fn, so it doesn't get the default -- that needs to be on the impl fn as well! Right?
I logged as https://clojure.atlassian.net/browse/ASYNC-270
will fix in next alpha, thanks