 The closure.core namespace contains many functions for working with collections, here we'll cover the most essential. First, the count function returns the number of elements or key value pairs in a collection. The list question mark function returns true if the argument is a list, otherwise it returns false. Vector question mark returns true if the argument is a vector, otherwise it returns false. And map question mark returns true if the argument is a map, it otherwise returns false. The contains question mark function returns true if the collection contains a specified key or index and otherwise it returns false. So, here for example, the first call to count returns to because the map argument has two key value pairs. The second call returns five because the vector argument has five elements. The third call also returns five because the list argument here has five elements. Notice that we quote the list so that it is not evaluated but instead just passed to count as itself. The first call to contains here returns true because the map argument does have a key which is the number three. The second call to contains returns false because the map argument does not have a key which is the string high. The third call to contains returns true because the vector does have an index two, but the fourth call to contains returns false because the vector has no index negative seven. This last call to contains also returns false because contains always returns false for a list argument. Here are four more functions. The cons function short for conjoin returns a new collection with an added element or key value pair. The asoak function short for associate returns a new collection with an added or modified value for a particular key or index. The asoak function short for dissociate returns a new map in which a particular key has been removed. And the merge function returns a new map that combines the key value pairs of one or more maps. Looking at some examples, the first call to cons returns a new map just like its map argument but with the addition of the key value pair specified in the other argument to cons. In the second call, the original map already has a key high and so cons returns a new map in which the key high has the value seven. For vectors, conge appends the new element to the end, but for lists conge prepends the new element to the front. So the third call to conge returns a new vector with the value true appended to the end and the fourth call here returns a new list with the value true prepended to the front. Used on a map, the asoak function is just like conge except the key and value are passed separately instead of together in a vector. Used on a vector, the asoak function expects an index and a value to put at that index. In this first example, asoak returns a new vector in which the value true replaces the value at index three. In the second example, the index five equals the original vectors count, so asoak returns a vector that is one element longer. In the third example, the index six is greater than the original vectors count and so is considered out of bounds. As the last example shows, asoak does not work on lists and so will throw an exception when passed a list argument. The first dissoak call here returns a new map that removes the string key high. The second dissoak call returns the original map because that original map contains no string key by. Despite what you might expect, dissoak does not work on vectors and so will throw an exception when passed a vector. The first merge call here has only one map argument and so simply returns the original map. The second merge call returns a new map in which the key value pairs of the second are added to the first, overriding existing values for keys as necessary. Notice that the returned maps key high has the value seven, not eight. The third merge call returns a new map in which the key value pairs of the successive maps are added to the first, left to right, overriding existing values for a key as necessary. So notice that the returned maps key, yo, has the value five, not four. Here we have three more collection functions, get returns the value of a particular key or index in a collection, pop returns a new collection that omits the first element or key value pair in a collection, peak returns the element or key value pair that would be removed by pop. So here in the first call to get, the map has the value eight for the key high. In the second call to get, the map has no key by and so get returns nil. In the third call to get, the vector has the value nine at index two. In the fourth call to get, the vector has no value at index six and so we get back nil. The last call to get returns nil because get always returns nil when passed a list. For vectors, pop removes the last element, but for lists, pop removes the first element. Again, this difference stems from the structural differences between vectors and lists. For vectors, it is most efficient to remove a trailing element, but for lists, it is most efficient to remove a leading element. So peak here on this vector returns 11 because pop would remove that element of the vector and peak on the list here returns seven because pop would remove that element of the list. Neither pop nor peak work on maps.