I had a problem understanding how these functions update the base ref, atom, etc.
The docs say: (apply f arguments to the current identity value)
(def one (atom 0)) (swap! one inc) ;; => 1
So I wonder how it is βexpandedβ in the application form. He did not mention what βargumentsβ are in the form used. Is this a sequence of arguments or are these separate values?
Was it "expanded" to:
(apply inc 0) ; obviously this wouldnt work, so that leaves only one possibility (apply inc 0 '()) (swap! one + 1 2 3) ;; #=> 7
It:
(apply + 1 1 2 3 '()) ;or (apply + 1 [1 2 3]) (def two (atom [])) (swap! two conj 10 20) ;;
It:
(apply conj [] [10 20]) ;or (apply conj [] 10 20 '())
mekka source share