Vance Shipley <>
Mon May 27 21:28:07 CEST 2002

Today I was bitten once again by the using the wrong variable.

foo(Value) ->
	Value2 = bar(Value),
	Value3 = baz(Value2),
	Value4 = zab(Value3),
	{ok, Value4}.

With something like the above I later add another step and everything
has to be rewritten.  If I forget a step somewhere it compiles and
runs but the wrong value is used in the place where the code wasn't
updated correctly.  

The idea of having the linter follow a coding style such as used above 
and warn when a variable version older than the most recently assigned
is used was discussed on the list some time ago.  That would have 
prevented me from tripping up today.

Is that plan any closer to being implemented?

The other thought I had was a forget() BIF like in the shell.  Is that
a bad idea?


More information about the erlang-questions mailing list