ok or true? (fwd)

Kostis Sagonas <>
Mon Feb 23 12:45:44 CET 2004


Thomas Lindgren <> wrote:
 >
 > > In general you should stick to regular return values
 > > like
 > > 
 > >     {ok, Val} | {error, Why}
 > > 
 > >     {value, V} | error
 > > 
 > > for the same reason
 > 
 > Case in point:
 > 
 >       lists:keysearch -> {value,X} | false
 > 
 > Argh. Oh well, one can always wrap such madness.

I guess list:keysearch HAS to wrap its result, so that it can
also return the atom 'false' or 'error' or anything similar.

Kostis.




More information about the erlang-questions mailing list