[erlang-questions] Overriding built-in functions in a module

Igor Ribeiro Sucupira igorrs@REDACTED
Fri Jun 11 02:34:14 CEST 2010


On Thu, Jun 10, 2010 at 8:58 PM, Richard O'Keefe <ok@REDACTED> wrote:
>
> On Jun 10, 2010, at 1:40 AM, Raimo Niskanen wrote:
>>
>> I might argue that since it is a call to an exported function it must be
>> to some *other* function, not the local with the same name.
>
> Why?  Suppose we have a module
>
>        -module(foo).
>        -export([bar/1]).


Although he didn't say it explicitly, he was talking about your
original code, in which the function bar/1 was not exported.
So, the matter was again the same: the call was to an exported
function, your original bar/1 function was not exported, that makes it
unreachable, we think it's reasonable to call that "unused" and you
don't. There was not much more in the last messages of this
discussion.  :-)

Best regards.
Igor.

>        bar(N) when N > 0 -> ?MODULE:bar(N-1);
>        bar(0) -> 'DONG!'.


More information about the erlang-questions mailing list