From f3c55529dbc9cb3bf8801bea9b64da78b9b73d5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn-Egil=20Dahlberg?= Date: Sun, 10 Apr 2016 23:09:54 +0200 Subject: stdlib: Document maps:take/2 --- lib/stdlib/doc/src/maps.xml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'lib') diff --git a/lib/stdlib/doc/src/maps.xml b/lib/stdlib/doc/src/maps.xml index 0f58f19421..97a7438890 100644 --- a/lib/stdlib/doc/src/maps.xml +++ b/lib/stdlib/doc/src/maps.xml @@ -300,6 +300,30 @@ false + + + + +

+ The function removes the Key, if it exists, and its associated value from + Map1 and returns a tuple with the removed Value and + the new map Map2 without key Key. + If the key does not exist error is returned. +

+

+ The call will fail with a {badmap,Map} exception if Map1 is not a map. +

+

Example:

+ +> Map = #{"a" => "hello", "b" => "world"}. +#{"a" => "hello", "b" => "world"} +> maps:take("a",Map). +{"hello",#{"b" => "world"}} +> maps:take("does not exist",Map). +error +
+
+ -- cgit v1.2.3