This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-07-27
Channels
- # beginners (43)
- # boot (1)
- # cider (7)
- # cljdoc (10)
- # clojure (110)
- # clojure-boston (1)
- # clojure-finland (2)
- # clojure-italy (19)
- # clojure-losangeles (1)
- # clojure-new-zealand (1)
- # clojure-nl (4)
- # clojure-spec (34)
- # clojure-uk (163)
- # clojurescript (136)
- # code-reviews (1)
- # component (13)
- # cursive (18)
- # datomic (99)
- # emacs (14)
- # events (4)
- # fulcro (14)
- # hoplon (15)
- # hyperfiddle (3)
- # jobs (3)
- # jobs-discuss (1)
- # lein-figwheel (10)
- # onyx (1)
- # pedestal (8)
- # re-frame (5)
- # reitit (4)
- # rum (1)
- # shadow-cljs (317)
- # spacemacs (24)
- # specter (9)
- # sql (2)
- # tools-deps (6)
- # yada (3)
(defrecord Person [name age])
;;=> user.Person
(def ertu (->Person "Ertu" 24))
;;=> #'user/ertu
(record? ertu)
;;=> true
(record? (assoc ertu :address "Somewhere"))
;;=> true
;;removing base fields converts record to regular map
(record? (dissoc ertu :name))
;;=> false
(defrecord ExampleComponent [options cache database scheduler]
component/Lifecycle
(start [this]
(println ";; Starting ExampleComponent")
;; In the 'start' method, a component may assume that its
;; dependencies are available and have already been started.
(assoc this :admin (get-user database "admin")))
(stop [this]
(println ";; Stopping ExampleComponent")
;; Likewise, in the 'stop' method, a component may assume that its
;; dependencies will not be stopped until AFTER it is stopped.
this))
no, you can't add new base fields to a record
so you should be able to safely dissoc
easy to check that in a repl btw