[erlang-questions] lists:reverse/1 as a built-in function

Thomas Lindgren thomasl_erlang@REDACTED
Tue Jan 9 16:21:29 CET 2007


--- Richard Carlsson <richardc@REDACTED> wrote:

> Once upon a time, for some random reason, the
> unfortunate choice was
> made to let the auto-imported functions take
> priority over any locally
> defined function of the same name. /.../

Arguably (indeed, reasonably), behaving this way is a
big honking bug, because it contradicts ordinary
scoping and makes the language (or OTP:s
implementation of it) behave peculiarly in various
ways. There is no good reason to keep it around for
anyone except for hypothetical projects that now may
rely on this bug. And even they might be happier to
get rid of it. It's not hard.

(For guards, the compiler would still have to resolve
all calls into the appropriate guard function calls,
i.e., erlang:*. But guards are basically outside the
normal hierarchy since you can't define new guard
operations or new guard scopes.)

If backwards (bugwards...) compatibility is desired,
that could instead be provided with a compiler switch
(--auto-imports-override-locals or whatever). Less
broken misfeatures have been removed this way before,
so I don't see why this one has to be kept around.

Best,
Thomas


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the erlang-questions mailing list