This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-07-24
Channels
- # beginners (10)
- # boot (14)
- # cider (80)
- # clara (1)
- # cljs-dev (19)
- # cljsrn (7)
- # clojure (284)
- # clojure-france (4)
- # clojure-italy (57)
- # clojure-poland (8)
- # clojure-russia (10)
- # clojure-spec (65)
- # clojure-uk (155)
- # clojurescript (156)
- # code-reviews (6)
- # copenhagen-clojurians (16)
- # cursive (10)
- # datomic (10)
- # emacs (13)
- # euroclojure (1)
- # graphql (4)
- # jobs (2)
- # lein-figwheel (3)
- # luminus (4)
- # off-topic (2)
- # onyx (42)
- # parinfer (23)
- # pedestal (1)
- # protorepl (8)
- # re-frame (34)
- # reagent (17)
- # ring-swagger (5)
- # timbre (24)
- # vim (72)
- # yada (1)
I came across a line in a book (web dev with clojure) where (-> #‘handler wrap-something wrap-another) I’m wondering what’s going on
(def a 10)
(def b #'a)
(def c a)
;; redefine a, imagine you ran this at the repl
(def a 20)
(println "a: " a)
;; => 20
;; the new value
(println "b: " @b)
;; => 20
;; the new value, even though it was defined _before_ the new value was given to `a`, this is because vars are like references
(println "c: " c)
;; => 10
;; this is because it was defined based on the _value_ of a.
I put this together for you 🙂. You can copy it into https://app.klipse.tech to play around with it.#'x => (var x)
you can get more information about var here - https://clojure.org/reference/special_forms, in one sentence - #'foo
must be resolved to var (not a value) of foo with metadata.
@delaguardo Thank you very much