Fork me on GitHub
#joker
<
2019-05-28
>
Candid02:05:19

syntax-quote (`) actually resolves the symbol, while regular quote doesn't

Candid02:05:48

compare

(require '[joker.os :as os])
(println `os/t)

Candid02:05:02

prints joker.os/t

Candid02:05:15

(require '[joker.os :as os])
(println 'os/t)

Candid02:05:24

prints os/t

Candid02:05:09

that's why qualified symbols inside syntax-quote "use" required namespaces

Candid02:05:08

so the former doesn't trigger "unused namespace" warning while the latter does

borkdude07:05:55

it will still work when it can’t be resolved though, but you’re right, when it’s there, it is used:

user=> (defmacro foo [] `foo/includes?)
#'user/foo
user=> (macroexpand '(foo))
foo/includes?
user=> (require '[clojure.string :as foo])
nil
user=> (macroexpand '(foo))
foo/includes?
user=> (defmacro foo [] `foo/includes?)
#'user/foo
user=> (macroexpand '(foo))
clojure.string/includes?