Urara-Blog/node_modules/.pnpm-store/v3/files/67/77ba4781abe864b636a5d704962672de47957d1cb0ed5eaab6c393f714a72e9c4611a3145030ef389c5ff12c631c54de847b311d4a1e0cd9042d1863293117
2022-08-14 01:14:53 +08:00

14 lines
No EOL
417 B
Text

(let [my-vector [1 2 3 4]
my-map {:fred "ethel"}
my-list (list 4 3 2 1)]
(list
(conj my-vector 5)
(assoc my-map :ricky "lucy")
(conj my-list 5)
;the originals are intact
my-vector
my-map
my-list))
-> ([1 2 3 4 5] {:ricky "lucy", :fred "ethel"} (5 4 3 2 1) [1 2 3 4] {:fred "ethel"} (4 3 2 1))
;From https://clojure.org/about/functional_programming#_immutable_data_structures