From 8f3536583a6338e3a61dbf008d674f54a77e401c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= Date: Wed, 21 Feb 2018 12:57:25 +0100 Subject: Add ets:whereis/1 for resolving table names -> tid() --- lib/stdlib/doc/src/ets.xml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/stdlib/doc/src/ets.xml') diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml index 1b31a1ec9d..b616e97714 100644 --- a/lib/stdlib/doc/src/ets.xml +++ b/lib/stdlib/doc/src/ets.xml @@ -487,6 +487,11 @@ Error: fun containing local Erlang function calls

The pid of the heir of the table, or none if no heir is set.

+ {id, + tid()} + +

The table identifier.

+
{keypos, integer() >= 1}

The key position.

@@ -2037,6 +2042,21 @@ true + + + + Retrieves the tid() of a named table. + +

This function returns the + tid() of the named table + identified by TableName, or undefined if + no such table exists. The tid() can be used in place of the + table name in all operations, which is slightly faster since the name + does not have to be resolved on each call.

+

If the table is deleted, the tid() will be invalid even if + another named table is created with the same name.

+
+
-- cgit v1.2.3 From 3e14c0e9f81e34c78c609da4b77c32d208a34d93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20H=C3=B6gberg?= Date: Thu, 22 Feb 2018 11:31:34 +0100 Subject: Clarify the named_table option to ets:new/2 --- lib/stdlib/doc/src/ets.xml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'lib/stdlib/doc/src/ets.xml') diff --git a/lib/stdlib/doc/src/ets.xml b/lib/stdlib/doc/src/ets.xml index b616e97714..305376a425 100644 --- a/lib/stdlib/doc/src/ets.xml +++ b/lib/stdlib/doc/src/ets.xml @@ -1079,10 +1079,13 @@ ets:select(Table, MatchSpec),
named_table -

If this option is present, name Name is - associated with the table identifier. The name can then - be used instead of the table identifier in subsequent - operations.

+

If this option is present, the table is registered under its + Name which can then be used instead of the + table identifier in subsequent operations.

+

The function will also return the Name + instead of the table identifier. To get the table identifier of a + named table, use + whereis/1.

{keypos,Pos} -- cgit v1.2.3