and-ing, or-ing?

chris.danx chris.danx@REDACTED
Sun May 18 20:58:43 CEST 2003


Vladimir Sekissov wrote:
> Good day,
> 
> existsVertex(N, Graph) and existsVertex(M, Graph)
> 
> or better
> 
> existsVertex(N, Graph) andalso existsVertex(M, Graph)


thanks!


> And slightly shorter function for your case would be
> 
> existsVertexes(Vertexes, {graph, G}) ->
>   ExistsVertexes = [N || {N, _} <- G, lists:memeber(N,Vertexes) == true],
>   length(Vertexes) == length(ExistsVertexes).
> 
> existsVertexes([N, M], Graph).

Thankyou, I didn't know Erlang had list comprehensions... maybe I missed 
it in the Erlang book?  I will look later.


Chris




More information about the erlang-questions mailing list