Using ets:match outside of ets?

Pierpaolo BERNARDI bernardp@REDACTED
Tue Mar 4 09:17:24 CET 2003


From: "Shawn Pearce" <spearce@REDACTED>

> I basically need to do something like:
> 
> M = #some_rec{f1=Type,f2=Y,_='_'}, % MatchSpec as per ets:match
> P = #some_rec{...}, % object to test
> case match(M, P) of
> true ->
> % good;
> false ->
> % bad;
> end.
> 
> ideas?

the function ets:test_ms/2 does *almost* exactly what you want.
Perhaps you can adapt your code to use it.

P.




More information about the erlang-questions mailing list