This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-09
Channels
- # babashka (22)
- # beginners (58)
- # calva (14)
- # clj-kondo (3)
- # cljs-dev (4)
- # clojure (17)
- # clojure-dev (4)
- # clojure-italy (6)
- # clojure-uk (2)
- # clojurescript (32)
- # conjure (9)
- # cursive (2)
- # figwheel-main (48)
- # fulcro (77)
- # helix (2)
- # jobs-discuss (3)
- # joker (2)
- # pathom (3)
- # quil (3)
- # re-frame (24)
- # reitit (6)
- # shadow-cljs (11)
- # tools-deps (8)
- # xtdb (29)
Question: what is the code equivalent for (load-string "(ns pod.borkdude.clj-kondo)")
? When I use create-ns
and then use require
on the namespace, it throws, but not when I use the load-string
snippet
user=> (binding [*ns* *ns*] (in-ns 'bar) (refer-clojure))
nil
user=> (require '[bar])
Execution error (FileNotFoundException) at user/eval156 (REPL:1).
Could not locate bar__init.class, bar.clj or bar.cljc on classpath.
Hello. What do the cool-kids use? spec or typed-clojure?
Coming from someone who would not describe himself as a cool kid, and also one who has not used either, spec gets asked about a lot more here than typed-clojure does, so seems to get more active use.
I see, thanks. You are cool.
@U0140AKS332 They're very different approaches. Typed Clojure is a static analysis project: you add annotations to your code and run the analyzer and it tells you whether or not it is "correctly typed". Spec is a set of tools that provide runtime checking of functions and data structures, as part of development/testing, or for data validation in production code. I wrote up all the different ways we use Spec at work https://corfield.org/blog/2019/09/13/using-spec/