Lists search by first element of a tuple

Mats Cronqvist <>
Wed Feb 8 11:52:12 CET 2006


> 
> But why does not [X || X={{1,_},_} <- L] work when [X || {{1,_},_}=X <- 
> L] works?    (tested on R9C )
> 
> 1> [X||{1,_}=X<-[{2,3},{1,4},b,{1,7},c]].
> [{1,4},{1,7}]
> 2> [X||X={1,_}=<-[{2,3},{1,4},b,{1,7},c]].
> ** 1: variable '_' is unbound **

   because of the typo ( =<- )?



More information about the erlang-questions mailing list