This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2023-06-22
Channels
- # ai (1)
- # announcements (4)
- # babashka (23)
- # beginners (27)
- # biff (17)
- # calva (5)
- # clerk (6)
- # clj-commons (27)
- # clj-kondo (35)
- # clojars (12)
- # clojure (27)
- # clojure-denver (3)
- # clojure-europe (71)
- # clojure-norway (7)
- # clojure-spec (5)
- # clojure-uk (2)
- # clojurescript (45)
- # data-science (9)
- # datomic (4)
- # dev-tooling (2)
- # devcards (1)
- # hoplon (2)
- # hyperfiddle (36)
- # introduce-yourself (3)
- # malli (11)
- # missionary (2)
- # off-topic (63)
- # polylith (5)
- # rdf (2)
- # reagent (12)
- # schema (1)
- # shadow-cljs (11)
- # sql (6)
- # tools-deps (23)
- # xtdb (6)
I have a strange error (because I can't find any references to this) on having a spec from another namespace that is only required and used in a (comment ...) block causing a compile failure. Is that a special case similar to unknown reader tags in the comment block that will cause it to fail since it attempts to parse that anyway?
You mean this reader error:
> clj
Clojure 1.11.1
user=> (comment
(require '[foo.bar :as quux])
::quux/wibble
Syntax error reading source at (REPL:4:0).
Invalid token: ::quux/wibble
user=>
That's because the contents of the comment
must be syntactically valid Clojure tokens, and because the require
is runtime and not evaluated, the auto-resolving keyword prefix ::quux
cannot be expanded.
You could either add the require to your ns
(even tho' it wouldn't be used elsewhere -- you could use :as-alias
instead of :as
if you don't want it to be actually loaded assuming you're on a recent enough version of Clojure) or you could use the fully-qualified Spec name instead of using the alias.
Thanks Sean, makes sense, I added a partner dev who cleaned up that namespace since it wasn’t used (coming from a typed language and the non use of that ns bugged him).