I'm fairly new to Clojure and I'm having a difficult time understanding what's happening behind the scenes with the following code:
; Associate the symbol 'fruits to the value ["apple" "banana"]
(def fruits ["apple" "banana"]) ; returns the var #'user/fruits
(count fruits) ; returns 2
(def fruits ["cherry" "orange" "grapes"]) ; returns the var #'user/fruits
(count fruits) ; returns 3
- Is each "def" form returning a NEW var data structure that's named #'user/fruits?
- It seems like the symbol 'fruits is bound to a different var after each "def" form - is this because whatever structure that represents the binding is a mutable data structure?