I agree with Thomas, this is a terrible wart and a BUG, whichever way you look at it. Very very bad, for several reasons:<br>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.
<br>2) An excellent way to future-buggify existing code. Who knows when some funciton will become a BIF, and break currently running code?<br>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...
<br><br>If anyone asks, I support Thomas's suggestion for preserving backward compatibility via compiler flags :)<br><br><div><span class="gmail_quote">On 1/12/07, <b class="gmail_sendername">Thomas Lindgren</b> <<a href="mailto:firstname.lastname@example.org">
email@example.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br>--- Robert Virding <<a href="mailto:firstname.lastname@example.org">
email@example.com</a>> wrote:<br>> So with this in mind it is not really strange that<br>> BIFs are<br>> auto-imported, and have priority over "normal"<br>> functions defined in<br>> modules; they are part of the language. It is
<br>> perhaps unfortunate that<br>> we allowed definition of functions with the same<br>> name and arity as the<br>> auto-imported ones.<br><br>It might have seemed like a good design choice at the<br>time, but note that auto-import (with "override") has
<br>several unfortunate ramifications, which is why it<br>should be aged out. As Richard mentioned, one such<br>consequence is the difficulty in extending the set of<br>BIFs.<br><br>Standardizing the set of functions implemented in C
<br>doesn't sound like a viable long term solution (nor<br>does standardizing the set of overridden functions).<br>Disallowing functions with the same names as builtins<br>doesn't sound like a very good design choice either.
<br>Do note that there already is a simple,<br>straightforward option that does the right thing.<br><br>Best,<br>Thomas<br><br><br><br><br>____________________________________________________________________________________
<br>8:00? 8:25? 8:40? Find a flick in no time<br>with the Yahoo! Search movie showtime shortcut.<br><a href="http://tools.search.yahoo.com/shortcuts/#news">http://tools.search.yahoo.com/shortcuts/#news</a><br>_______________________________________________
<br>erlang-questions mailing list<br><a href="mailto:firstname.lastname@example.org">email@example.com</a><br><a href="http://www.erlang.org/mailman/listinfo/erlang-questions">http://www.erlang.org/mailman/listinfo/erlang-questions