Erlang is getting too big
Tue Oct 14 21:12:16 CEST 2003
--- Richard Carlsson <richardc@REDACTED> wrote:
> On Tue, 14 Oct 2003, Thomas Lindgren wrote:
> > > But since auto-recognized BIFs override local
> > > definitions (sic!),
> > > this would probably break a lot of existing
> > If you mean BIFs that do not need the erlang:
> > then the override nowadays goes in the other
> > direction. (And correctly so, IMO.)
> > -module(test).
> > -compile(export_all).
> > abs(X) when X > 0 ->
> > X;
> > abs(X) ->
> > -X.
> > 1> c(test).
> > ... Warning: defining BIF abs/1
> Ah, but that warning only tells you that you have
> a function called abs/1, which is also the name of
> auto-recognized BIF.
> And if you call it from the outside, as in
> your function is called, as you expect.
> But if you try to use it for a local call, you get
> trouble, because it is overridden by the BIF:
As the saying goes, I stand corrected. (Thanks also to
Dan G for pointing this out.)
So, um, well, *shouldn't* a local call really go to
the local version too? I think it should.
Again, I would suggest sailing through the transition
period with a linter. E.g., emit warnings or even
errors when finding a call which is ambiguous in this
respect. (The linter probably should do that anyway.)
Do you Yahoo!?
The New Yahoo! Shopping - with improved product search
More information about the erlang-questions