Pattern matching: Skipping the rest of a tuple

Joel Reymont <>
Thu Dec 29 00:43:39 CET 2005


Uffe,

Thank you kindly for offering an in-depth solution.

Isn't it ... just a touch complicated, though?

I suppose that everything is best learned in comparison and thus I'll  
stick with element(X,Tuple) :-).

	Thanks, Joel

On Dec 28, 2005, at 10:27 PM, Ulf Wiger wrote:

> Well, if you want to do something really absurd, try this:
>
> Eshell V5.4.8  (abort with ^G)
> 1> rd(rec, {a,b,c}).
> rec
> 2> R = #rec{a=1,b=2,c=3}.
> #rec{a = 1,b = 2,c = 3}
> 3> MS = ets:match_spec_compile([{#rec{a=1,_='_'},[],[true]}]).
> <<>>
> 4> ets:match_spec_run([R],MS).
> [true]

--
http://wagerlabs.com/








More information about the erlang-questions mailing list