From 031e4e19120af3e40fcc937bebb4cc45b59f5b87 Mon Sep 17 00:00:00 2001 From: Sverker Eriksson Date: Wed, 11 May 2016 19:08:49 +0200 Subject: erts: Fix confusion among match spec examples Tracing and ETS examples were not separated correctly under the corresponding headings. --- erts/doc/src/match_spec.xml | 75 +++++++++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 37 deletions(-) (limited to 'erts/doc/src/match_spec.xml') diff --git a/erts/doc/src/match_spec.xml b/erts/doc/src/match_spec.xml index 3944f24f84..ca73d78b8d 100644 --- a/erts/doc/src/match_spec.xml +++ b/erts/doc/src/match_spec.xml @@ -528,7 +528,7 @@
- ETS Examples + Tracing Examples

Match an argument list of three where the first and third arguments are equal:

has to be a proper list.

-

Match all objects in an ets table where the first element is - the atom 'strider' and the tuple arity is 3 and return the whole - object.

- -

Match all objects in an ets table with arity > 1 and the first - element is 'gandalf', return element 2.

- =',{size, '$1'},2}], - [{element,2,'$1'}]}] - ]]> -

In the above example, if the first element had been the key, - it's much more efficient to match that key in the - part than in the part. The search space of - the tables is restricted with regards to the so - that only objects with the matching key are searched. -

-

Match tuples of 3 elements where the second element is either - 'merry' or 'pippin', return the whole objects.

- -

The function can be useful for testing - complicated ets matches.

-
-
- Tracing Examples

Only generate trace message if trace control word is set to 1:

+ +
+ ETS Examples +

Match all objects in an ets table where the first element is + the atom 'strider' and the tuple arity is 3 and return the whole + object.

+ +

Match all objects in an ets table with arity > 1 and the first + element is 'gandalf', return element 2.

+ =',{size, '$1'},2}], + [{element,2,'$1'}]}] + ]]> +

In the above example, if the first element had been the key, + it's much more efficient to match that key in the + part than in the part. The search space of + the tables is restricted with regards to the so + that only objects with the matching key are searched. +

+

Match tuples of 3 elements where the second element is either + 'merry' or 'pippin', return the whole objects.

+ +

The function can be useful for testing + complicated ets matches.

+
-- cgit v1.2.3