Provides functions for creating and manipulating unordered maps.
Returns the value for the given key name from the provided map. If a vector of key names are provided, all of their values are returned in the listed order.
An optional default value may be provided which will be returned for any key which is not present in the map. Otherwise a nil is returned.
<map> <key name>|<vector of keys> [<default value>]
:emphasize-lines: 2,5 (get { :first-name "Bobby" :last-name "Sue" } :last-name) "Sue" (get { :a 10 :b 20 :c 30 :d 40 } [:a :c :e] 0) (10 30 0)
Returns a list of keys from the given map, in no guaranteed order.
<map>
:emphasize-lines: 2 (keys { :first-name "Bobby" :last-name "Sue" }) (:first-name :last-name)
Returns a list of values from the given map, in no guaranteed order.
:emphasize-lines: 2 (keys { :first-name "Bobby" :last-name "Sue" }) ("Bobby" "Sue")
Returns a new map containing the existing keys and values, as well as any new key-value pairs provided. Values default to undefined, and keys that already exist will have their values replaced.
Multiple key-value pairs may be provided. Providing no new key-value pairs will simply return the existing map.
<map> [<key> [<value>] [<key> [<value>] ...]]
:emphasize-lines: 2 (assoc { :old-key "foo" } :new-key "bar") { :old-key "foo" :new-key "bar" }
To install App::RoboBot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::RoboBot
CPAN shell
perl -MCPAN -e shell install App::RoboBot
For more information on module installation, please visit the detailed CPAN module installation guide.