[erlang-questions] erlang sucks
Michael Campbell
michael.campbell@REDACTED
Mon Mar 17 22:08:11 CET 2008
Jani Hakala wrote:
> attila.rajmund.nohl@REDACTED writes:
>
>> I don't think that immutable variables make it easier to write less
>> buggier code. On the contrary, I often see code like this:
>>
>> HR1=f(HugeRecord),
>> ...
>> g(HR1).
>>
>> Then someone adds a line to modify the HugeRecord and forgets to update
>> the call to 'g':
>>
>> HR1=f(HugeRecord),
>> HR2=f2(HR1),
>> ...
>> g(HR1).
>>
>> Now we have a stupid bug.
>>
> The compiler would warn about that
> Warning: variable 'HR2' is unused
Unless, in fact, it weren't unused... Something in the "..." could have used
it, no?
More information about the erlang-questions
mailing list