diff options
author | Björn-Egil Dahlberg <[email protected]> | 2014-05-26 16:38:50 +0200 |
---|---|---|
committer | Björn-Egil Dahlberg <[email protected]> | 2014-05-26 16:38:50 +0200 |
commit | 6b6cd01b607a1bfcf61bb6d5f4cc3fe9b37445db (patch) | |
tree | 3e6200ef0f4c9563957daac8f14298faeb314094 /lib/stdlib/doc | |
parent | 6731d295915448e4c219f1db1b146264ced68018 (diff) | |
parent | 47463022cea3b7ca89124c1607cf10b92fbb536f (diff) | |
download | otp-6b6cd01b607a1bfcf61bb6d5f4cc3fe9b37445db.tar.gz otp-6b6cd01b607a1bfcf61bb6d5f4cc3fe9b37445db.tar.bz2 otp-6b6cd01b607a1bfcf61bb6d5f4cc3fe9b37445db.zip |
Merge branch 'saa/add_default_value_for_maps_get/OTP-11951' into maint
* saa/add_default_value_for_maps_get/OTP-11951:
stdlib: Fix indentation of maps doc
Add docs and test for maps:get/3
Add default value for maps:get
Diffstat (limited to 'lib/stdlib/doc')
-rw-r--r-- | lib/stdlib/doc/src/maps.xml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/stdlib/doc/src/maps.xml b/lib/stdlib/doc/src/maps.xml index 76137e3dee..b37f7fd7fd 100644 --- a/lib/stdlib/doc/src/maps.xml +++ b/lib/stdlib/doc/src/maps.xml @@ -108,6 +108,26 @@ </func> <func> + <name name="get" arity="3"/> + <fsummary></fsummary> + <desc> + <p> + Returns the value <c><anno>Value</anno></c> associated with <c><anno>Key</anno></c> if + <c><anno>Map</anno></c> contains <c><anno>Key</anno></c>. + If no value is associated with <c><anno>Key</anno></c> then returns <c><anno>Default</anno></c>. + </p> + <p>Example:</p> + <code type="none"> +> Map = #{ key1 => val1, key2 => val2 }. +#{key1 => val1,key2 => val2} +> maps:get(key1, Map, "Default value"). +val1 +> maps:get(key3, Map, "Default value"). +"Default value"</code> + </desc> + </func> + + <func> <name name="is_key" arity="2"/> <fsummary></fsummary> <desc> |