Fork me on GitHub

looks like core.async doesn't compile with latest alpha


(:refer-clojure :exclude [..] :as core) fails spec


probably a bug in core.async as :as is not documented in refer but.. it's worked before and I bet a significant number of projects use it in refer-clojure


funny that it worked in the past, is that undefined behavior?

Alex Miller (Clojure team)17:03:05

I’ve looked through 20 pages of github results without finding another example so far


I'm sure I've done (;refer-clojure :exclude [..] :as c.c) somwhere in the past after seeing that in core.async


maybe I thought that the name "refer-clojure" would include an option to refer-clojure as something


the fact that refer-clojure is normally only used with :exclude seems bizzare, but what do I know


I'm fine with updating that code, to use :require [clojure.core :as core]


I think you can also use :rename with :refer-clojure (altho I've hardly ever seen anybody use :rename)


it looks like :as in :refer-clojure doesn't even work


and likely has never worked so ¯\(ツ)

Alex Miller (Clojure team)17:03:34

you can also use :only and :rename

Alex Miller (Clojure team)17:03:52

I just looked through 60 pages of results in github (so 600 example usages)

Alex Miller (Clojure team)17:03:08

I didn’t see any :as. mostly :exclude with the occasional :only

Alex Miller (Clojure team)17:03:20

I’m calling the spec good and async’s usage bad for now

Alex Miller (Clojure team)17:03:29

I’ll update async and do a release there


spec is good


looks like :as foo is ignored in :refer-clojure


it works in core.async because there's an explicit alias afterwards but it's a no-op there


so definitely a bug in async 👍

Alex Miller (Clojure team)17:03:17

I suppose you could see this as a bug in spec though - this is an example of the kind of options that should be “open"

Alex Miller (Clojure team)17:03:36

sorry “the refer-clojure spec” (not spec itself)


yeah gotcha

Alex Miller (Clojure team)17:03:47

as in, it did nothing, but should just continue doing nothing

Alex Miller (Clojure team)17:03:07

the refer-clojure spec is using (s/* (s/alt …)) but could use s/keys*

Alex Miller (Clojure team)17:03:30

I have to believe I did that intentionally, but I now have no memory why

Alex Miller (Clojure team)17:03:57

was probably trying to close the set to catch invalid things but this is like a year ago now