Immutable values
Fixme work in progress
Values in Clojure include numbers, characters and strings. When you use functions on these values they do not change, instead a new value is returned.
Lets look at a simple example with a number:
(def two-little-ducks 22)
(inc two-little-ducks)
;; => 23
two-little-ducks
;; => 22
Another example with a string:
(def message "Strings are immutable")
(str message "," " " "you cant change them")
;; => "Strings are immutable, you cant change them"
message
;; => "Strings are immutable"
Fixme Add an exercise
当前内容版权归 practicalli 或其关联方所有,如需对内容或内容相关联开源项目进行关注与资助,请访问 practicalli .