Torsten Anders wrote:
> On 13.03.2006, at 16:54, Raphael Collet wrote:
> 
>>>> Well, it is rather irritating, but sometimes it would help find some
>>>> shadowing problems. Which should be history now :-)
>>
>> On 13.03.2006, at 16:31, Yves Jaradin wrote:
>>
>>> It's also the only warning we get if we do something like:
>>> local
>>>   local
>>>      SomeId
>>>   in
>>>      SomzId={Browse}
>>>   end
>>> in
>>>   skip
>>> end
>>
>>
>> Ahem.  I have no doubt *you* are used to write this kind of things,
>> Yves... ;p
> 
> ;-) me too.. This warning also helped me several times in cases like
> when during refactoring I renamed a recursive function but didn't rename
> all its calls. I don't want to miss this warning.
> 
> Actually, when there is a variable you intent not to use (e.g. to comply
> some given interface), you may just call it _.

Erlang has a convention where variables that are intended to be unused have
names starting with _ (including _ itself). The compiler warns only about
non-use of variables that do not have a leading _. This is useful because
the _ acts as documentation that the variable is not used, but has very low
syntactic overhead.

I like this convention much better than unconditionally warning about unused
variables. In code that I write, unused variables are not infrequent, but
*almost* always occur only for code that is unfinished (and obviously so), or
for parameters that are intentionally not used by a particular implementation
of a function/procedure/method.

-- 
David Hopwood <[EMAIL PROTECTED]>


_________________________________________________________________________________
mozart-users mailing list                               
[email protected]
http://www.mozart-oz.org/mailman/listinfo/mozart-users

Reply via email to