ets:match_spec_run/2

Ulf Wiger etxuwig@REDACTED
Fri Apr 11 14:45:46 CEST 2003


I found this undocumented functionality in ets:

1> MS = ets:match_spec_compile([{{'_',2},[],['$_']}]).
<<>>
2> ets:match_spec_run([{a,1},{a,2},{b,2}], MS).
[{a,2},{b,2}

It's used e.g. when implementing mnesia:select().

What is the status of these two functions?

(I realise that you can write an erlang equivalent using for
example lists:filter() that's a lot prettier, but the point
(one point) of the function is obviously when you have a
match spec already and need to apply it to a list.)

BTW, what kind of magical empty binary is that?

/Uffe

-- 
Ulf Wiger, Senior Specialist,
   / / /   Architecture & Design of Carrier-Class Software
  / / /    Strategic Product & System Management
 / / /     Ericsson AB, Connectivity and Control Nodes




More information about the erlang-questions mailing list