OR construction in erlang ?

Mark Scandariato <>
Tue Apr 12 22:51:38 CEST 2005


Since lists:member/2 returns true or false, you're in luck:

lists:member(Key, List) orelse throw(key_error),
lists:member(Key2, List) andalso throw(key2_error),


Mark.

Olivier wrote:

> 
> I guess I'll have to do that, but it is basically a case / catch syntax 
> : how would you do it in this case:
> 
> ...
> true = lists:member(Key, List),
> false = lists:member(Key2, List),
> ...
> 



More information about the erlang-questions mailing list