core-async

maybenot 2025-12-23T15:45:55.467279Z

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)

seancorfield 2025-12-23T15:58:50.401029Z

Which version of core.async are you using? That error doesn't seem to line up with alpha2.

maybenot 2025-12-23T16:06:11.316689Z

it was indeed alpha 1 but after I changed it to 1.9.829-alpha2 the error is still there

Alex Miller (Clojure team) 2025-12-23T16:14:14.960469Z

because the options are after the &, these are varargs, so you don't put them in a map

seancorfield 2025-12-23T16:14:47.810799Z

In the error case it has no options tho'...?

Alex Miller (Clojure team) 2025-12-23T16:14:54.101539Z

or you're saying that without args it doesn't work

Alex Miller (Clojure team) 2025-12-23T16:15:04.436369Z

sorry, catching up

seancorfield 2025-12-23T16:15:21.762049Z

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:

Alex Miller (Clojure team) 2025-12-23T16:16:06.119959Z

yeah, this is a bug

seancorfield 2025-12-23T16:17:00.438639Z

Hmm, no, that's not quite it... `opts` is nil when options are omitted, and it passes that to the impl fn without any default behavior. Ah, {: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?

Alex Miller (Clojure team) 2025-12-23T16:20:11.415479Z

I logged as https://clojure.atlassian.net/browse/ASYNC-270

Alex Miller (Clojure team) 2025-12-23T16:20:20.554219Z

will fix in next alpha, thanks

1
🙌 2