Small poll
James Hague
james@REDACTED
Thu Jan 1 00:05:29 CET 2004
Joachim Durchholz wrote:
>Warnings are useful for those things that
>newbies often fall trap to: these should be
>warnings. Or at least warnings that can be
>switched on using a compiler option.
I agree in principle, but then you see newbies making errors that you
can't check for:
second([x,y|t]) -> y.
Where x, y, and t were intended to be variables, not atoms. Or using
"/" instead of "div". Or the more common case of calling an external
function with the wrong number of parameters, or simply a non-
existant external function (which, I admit, would be nice to check
for, though not so simple). It's a slippery slope to try to fix all
of these at compile time, and it isn't clear that an overly pedantic
compiler is a worthy goal. There should at least be consistent
principles for what is warned about and what isn't.
That said, I still like the new warning for "This statement will
never match," maybe just because I've seen similar warnings in ML-
like languages.
More information about the erlang-questions
mailing list