Skip to content

Commit

Permalink
Fix typo in :language:
Browse files Browse the repository at this point in the history
  • Loading branch information
jdeisenberg committed Mar 16, 2017
1 parent 831e6e4 commit 4a2a0c1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions _sources/maps2.rst
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ Modifying maps with ``update``
The ``update`` and ``update-in`` functions are similar to ``assoc`` and ``assoc-in``, in that they create modified versions of the original map. Instead of key and value pairs, you give a key and a function name and, if necessary, other arguments. The function is applied to the key and the arguments. If you wanted to chnge the ``province`` map for a 10% increase in population, you could do this:

.. activecode:: update_map
:languge: clojurescript
:language: clojurescript
:include: map_data_structure

(update province :population * 1.1)
Expand All @@ -154,4 +154,4 @@ Similarly, you can use ``update-in`` to update a value in a nested map. If, for
(defn upper [s] (.toUpperCase s))
(update-in event [:location :city] upper)

So, what is the difference between ``assoc`` and ``update``? If you want to replace a value with a new one, use ``assoc``. If you want to perform some operation on a value to create a new value, use ``update``.
So, what is the difference between ``assoc`` and ``update``? If you want to replace a value with a new one, use ``assoc``. If you want to perform some operation on a value to create a new value, use ``update``.

0 comments on commit 4a2a0c1

Please sign in to comment.