match List1 in List2

Asko Husso <>
Wed Sep 18 10:44:24 CEST 2002


> What would be the best way to return the list of tuples
> in List1 which match the tuples in List2?
> 
> List1 = [{foo, 13}, {bar, 42}, {fooz, 67}]
> List2 = [{baz, 15}, {booz, 145}, .....]
> 
> It seems to me that this should be a one liner but I've
> not found the simple solution yet.
> 
> 	-Vance

List2--(List2--List1).

That's another solution..

Asko Husso                       	E-mail:
Ericsson AB		  	        Phone: +46 8 7192324
Varuvägen 9B                               
S-126 25 Stockholm-Älvsjö, Sweden





More information about the erlang-questions mailing list