Erlang standard library quirks

Sean Hinde sean.hinde@REDACTED
Thu Feb 16 18:57:19 CET 2006


On 16 Feb 2006, at 17:45, Samuel Montgomery-Blinn wrote:

> James Hague wrote:
>
>> One more:
>>
>> lists:keysearch returns "{value, Tuple} | false" instead of just
>> "Tuple | false".
>>
>>
> This is to distinguish the value "false" from the return code of  
> "false", unless I am using the function incorrectly.

Except that it can never return a successful result of 'false' - on  
success it always returns a tuple.

Which is not to say that I do not also find it one of the most ugly  
constructs in the libraries (and how about that sentence for an ugly  
construct :-) ).

I have many times wrapped lists:keysearch in another function just to  
prevent the extra {value,..}  cruft crapping all over my code.

Sean





More information about the erlang-questions mailing list