underscore prefixed variables (was: Re: Noob - Getting Started Infinte Loop?)
Hakan Mattsson
hakan@REDACTED
Thu Aug 31 16:45:47 CEST 2006
On Thu, 31 Aug 2006, Fredrik Thulin wrote:
FT> I think that
FT>
FT> a) variables prefixed with "_" should really not be
FT> variables that get set - like the special case _.
FT> b) the compiler should issue a warning that you are
FT> actually using avariable prefixed with "_".
FT>
FT> Would others care to share their view on this?
I think that it is a splendid idea to have the
possibility to use anonymous variables with mnemonic
names. The current semantics is quite error prone. But
I suspect that there are production code out there that
is relying on the current behavior.
Your suggestion to add a new compiler warning should be
enough. It would give attention to the potential error
without breaking any existing code.
/Håkan
More information about the erlang-questions
mailing list