Fork me on GitHub
#clojure-dev
<
2017-03-14
>
bronsa16:03:18

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

bronsa16:03:37

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

bronsa16:03:36

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

tbaldridge17:03:56

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

bronsa17:03:35

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

tbaldridge17:03:56

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

tbaldridge17:03:29

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

tbaldridge17:03:46

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

bronsa17:03:55

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

bronsa17:03:34

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

bronsa17:03:06

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

bronsa17:03:02

spec is good

bronsa17:03:12

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

bronsa17:03:29

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

bronsa17:03:43

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)

bronsa17:03:41

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