Permalink
Browse files

Erroneous code example in documentation of select/2

  • Loading branch information...
1 parent b859ef3 commit 6f7f6c32e1a26c0df8215248a54594a05401b296 @uwiger committed Aug 14, 2013
Showing with 9 additions and 9 deletions.
  1. +4 −4 doc/gproc.md
  2. +1 −1 doc/gproc_dist.md
  3. +4 −4 src/gproc.erl
View
@@ -1456,10 +1456,10 @@ Note that limiting the context is just a convenience function, allowing you
to write a simpler select pattern and still avoid searching the entire
registry. Whenever variables are used in the head pattern, this will result
in a wider scan, even if the values are restricted through a guard (e.g.
-`select([{'$1','$2','$3'}, [{'==', '$1', p}], ...])` will count as a wild
-pattern on the key and result in a full scan). In this case, specifying a
-Context will allow gproc to perform some variable substitution and ensure
-that the scan is limited.
+`select([{'$1','$2','$3'}, [{'==', {element,1,'$1'}, p}], ...])`
+will count as a wild pattern on the key and result in a full scan).
+In this case, specifying a Context will allow gproc to perform some
+variable substitution and ensure that the scan is limited.
<a name="select-3"></a>
### select/3 ###
View
@@ -7,7 +7,7 @@
Extended process registry.
-__Behaviours:__ [`gen_leader`](/Users/uwiger/FL/git/gen_leader/doc/gen_leader.md).
+__Behaviours:__ [`gen_leader`](gen_leader.md).
__Authors:__ Ulf Wiger ([`ulf@wiger.net`](mailto:ulf@wiger.net)).
<a name="description"></a>
View
@@ -1220,10 +1220,10 @@ select(Pat) ->
%% to write a simpler select pattern and still avoid searching the entire
%% registry. Whenever variables are used in the head pattern, this will result
%% in a wider scan, even if the values are restricted through a guard (e.g.
-%% <code>select([{'$1','$2','$3'}, [{'==', '$1', p}], ...])</code> will count as a wild
-%% pattern on the key and result in a full scan). In this case, specifying a
-%% Context will allow gproc to perform some variable substitution and ensure
-%% that the scan is limited.
+%% <code>select([{'$1','$2','$3'}, [{'==', {element,1,'$1'}, p}], ...])</code>
+%% will count as a wild pattern on the key and result in a full scan).
+%% In this case, specifying a Context will allow gproc to perform some
+%% variable substitution and ensure that the scan is limited.
%% @end
select(Context, Pat) ->
ets:select(?TAB, pattern(Pat, Context)).

0 comments on commit 6f7f6c3

Please sign in to comment.