Proposed change to libraries

Chandrashekhar Mullaparthi Chandrashekhar.Mullaparthi@REDACTED
Fri Feb 4 14:31:28 CET 2005


I'm in favour of aligning the code to the documentation :-)

Chandru

> -----Original Message-----
> From: Kostis Sagonas [mailto:kostis@REDACTED] 
> Sent: 04 February 2005 13:18
> To: erlang-questions@REDACTED
> Subject: Proposed change to libraries
> 
> 
> We had an interesting discussion in the HiPE group today, so let
> me take a quick poll on the following issue.
> 
> The Erlang/OTP documentation specifies that e.g. lists:map/2 is
> -------------------------------------------------------------------
> map(Func, List1) -> List2
>    Types:
>       Func = fun(A) -> B
>       List1 = [A]
>       List2 = [B]
> -------------------------------------------------------------------
> 
> However, currently this does NOT agree with its implementation.
> For example, one can issue the call:
> 
>   lists:map(gazonk, [])
> 
> which will return [].
> 
> Will it cause havoc if in a future Erlang version such calls
> result in a 'function_clause' error?
> 
> I.e., change the implementation of map/2 (and similar functions)
> as if defined by:
> 
> map(F, [H|T]) ->
>   [F(H)|map(F, T)];
> map(F, []) when is_function(F) ->	%% andalso is_fun_arity(F) == 1
>   [].
> 
> 
> Kostis
> 



 NOTICE AND DISCLAIMER:
This email (including attachments) is confidential.  If you have received
this email in error please notify the sender immediately and delete this
email from your system without copying or disseminating it or placing any
reliance upon its contents.  We cannot accept liability for any breaches of
confidence arising through use of email.  Any opinions expressed in this
email (including attachments) are those of the author and do not necessarily
reflect our opinions.  We will not accept responsibility for any commitments
made by our employees outside the scope of our business.  We do not warrant
the accuracy or completeness of such information.




More information about the erlang-questions mailing list