diff options
author | Sergey Abramyan <[email protected]> | 2014-04-15 11:45:37 +0400 |
---|---|---|
committer | Sergey Abramyan <[email protected]> | 2014-04-15 11:45:37 +0400 |
commit | 6e6b66218b8ce1f68ca9fd68690ee93d6c98bb05 (patch) | |
tree | d64d3802a1d5c29988e56dbad9d321082597f706 /lib/stdlib/doc | |
parent | ad4c02a9d7794727c78d36bd47b7272af3efc523 (diff) | |
download | otp-6e6b66218b8ce1f68ca9fd68690ee93d6c98bb05.tar.gz otp-6e6b66218b8ce1f68ca9fd68690ee93d6c98bb05.tar.bz2 otp-6e6b66218b8ce1f68ca9fd68690ee93d6c98bb05.zip |
Add docs and test for maps:get/3
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..a6bb120d07 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> |