Using ets:match outside of ets?

Shawn Pearce spearce@REDACTED
Tue Mar 4 09:58:29 CET 2003


Doh!  I remember seeing that function 2 days ago.  :)

These darn docs cover so much stuff!

Thanks, I'll try ets:test_ms/2, it does look like it would
work for me.


Pierpaolo BERNARDI <bernardp@REDACTED> wrote:
> 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.
> 

-- 
Shawn.

  The only way to keep your health is to eat what you don't want, drink what
  you don't like, and do what you'd rather not.
  		-- Mark Twain



More information about the erlang-questions mailing list