From 0e464f7be1ae9b54d0fba748ab2dc7bd435ac118 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 9 May 2014 16:01:49 +0200 Subject: Create new BIF ets:update_counter/4 Conflicts: erts/emulator/beam/bif.tab lib/stdlib/src/ets.erl --- lib/stdlib/doc/src/ets.xml | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'lib/stdlib/doc') diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml index 902a921fbf..6b9524ef63 100644 --- a/lib/stdlib/doc/src/ets.xml +++ b/lib/stdlib/doc/src/ets.xml @@ -1618,14 +1618,18 @@ true + + + + Update a counter object in an ETS table.

This function provides an efficient way to update one or more @@ -1667,12 +1671,22 @@ true lookup/2 and new/2 for details on the difference).

+

If a default object Default is given, it is used + as the object to be updated if the key is missing from the table. The + value in place of the key is ignored and replaced by the proper key + value. The return value is as if the default object had not been used, + that is a single updated element or a list of them.

The function will fail with reason badarg if:

the table is not of type set or ordered_set, - no object with the right key exists, + no object with the right key exists and no default object were + supplied, the object has the wrong arity, + the default object arity is smaller than + ]]> + any field from the default object being updated is not an + integer the element to update is not an integer, the element to update is also the key, or, any of Pos, Incr, Threshold or -- cgit v1.2.3