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

Alex Arnon <>
Sun Jan 14 22:33:03 CET 2007


I agree with Thomas, this is a terrible wart and a BUG, whichever way you
look at it. Very very bad, for several reasons:
1) Breaks the Principle of Least Astonishment. I'm certainly a little
shocked to learn of it, and I've been mucking about with Erlang for awhile.
2) An excellent way to future-buggify existing code. Who knows when some
funciton will become a BIF, and break currently running code?
3) The "function call" concept is overloaded without any indication (unless
you slog through the docs, and again things might change from version to
version). If you want to give certain functions a different stature, make it
easily evident in the syntax. And the inconsistency with some BIFs having to
be called with "erlang:" prepended...

If anyone asks, I support Thomas's suggestion for preserving backward
compatibility via compiler flags :)

On 1/12/07, Thomas Lindgren <> wrote:
>
>
> --- Robert Virding <> wrote:
> > So with this in mind it is not really strange that
> > BIFs are
> > auto-imported, and have priority over "normal"
> > functions defined in
> > modules; they are part of the language. It is
> > perhaps unfortunate that
> > we allowed definition of functions with the same
> > name and arity as the
> > auto-imported ones.
>
> It might have seemed like a good design choice at the
> time, but note that auto-import (with "override") has
> several unfortunate ramifications, which is why it
> should be aged out. As Richard mentioned, one such
> consequence is the difficulty in extending the set of
> BIFs.
>
> Standardizing the set of functions implemented in C
> doesn't sound like a viable long term solution (nor
> does standardizing the set of overridden functions).
> Disallowing functions with the same names as builtins
> doesn't sound like a very good design choice either.
> Do note that there already is a simple,
> straightforward option that does the right thing.
>
> Best,
> Thomas
>
>
>
>
>
> ____________________________________________________________________________________
> 8:00? 8:25? 8:40? Find a flick in no time
> with the Yahoo! Search movie showtime shortcut.
> http://tools.search.yahoo.com/shortcuts/#news
> _______________________________________________
> erlang-questions mailing list
> 
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20070115/257f1b4f/attachment.html>


More information about the erlang-questions mailing list