Given this empty map,

(def mtr-map {})

this sequence,

(def mtr-seq ["a" 1 "b" 2 "c" 3 "d" 4])

this function,

(defn map-mtr
    [read-map premid reading]
    (conj read-map {premid reading}))

and this call

(map-mtr mtr-map (first mtr-seq) (first (rest mtr-seq)))

mtr-map won't update, but redefining the function to take premid and
reading and allowing the function to operate on the global variable
mtr-map.

 (defn map-mtr
        [premid reading]
        (conj mtr-map {premid reading}))

mtr-map becomes updated.

I'm confused as to how to update mtr-map by allowing it to be passed
into the function in the first example.

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en

Reply via email to