Fork me on GitHub
#clojure-spec
<
2019-03-26
>
rickmoynihan17:03:22

ahh might be an old spec version…

rickmoynihan17:03:44

Yeah I had an old spec; can confirm the issue is gone when using latest spec1 😌

ag21:03:03

when defining a fdef spec for a function that is in different namespace, I can use fully qualified name. How can I alias fully-qualified part? e.g: - fn implementation of foo is in core.common - spec is in core.specs - I can do (s/fdef core.common/foo bla-bla-bla) I cannot require core.common in core.specs, to avoid circular reference since specs are used in core.common. But because I’m using qualified name of foo - instrumentation still works. But how can I use alias for core.common, so I don’t have to repeatedly write it fully? clojure.core/alias doesn’t work, because core.common cannot be imported in this namespace

didibus21:03:53

I don't think there's a way.

Alex Miller (Clojure team)21:03:13

currently, you can't do this (other than by creating it as a namespace, which will then allow you to alias it).

ag21:03:28

(╯°□°)╯︵ ┻━┻ I’m sad and dissatisfied. It is totally entire Cognitect’s fault.

lilactown21:03:43

it’s beginning to feel like we need something like alias but that doesn’t require the namespace to be loaded

ag21:03:32

yeah… please have it… or I’m gonna… about to.. leave Clojure and do…. I dunno something else… woodworking or papier mache figurines to sell them on farmer’s market

lilactown21:03:40

esp. in ClojureScript where you can’t even ad-hoc create the namespace

Alex Miller (Clojure team)21:03:44

yeah, this is something we've talked about for a while and there is a ticket placeholder for it

Alex Miller (Clojure team)21:03:06

we would like to have a lighter-weight aliasing mechanism (lighter than "creating namespaces") and I expect that could be used in both clj and cljs

Alex Miller (Clojure team)21:03:40

hoping to do some work on this in 1.11

Alex Miller (Clojure team)21:03:07

I feel your pain :)

❤️ 20
4
👍 4