[erlang-questions] Simple Erlang Recommendation (last returned value)

Richard A. O'Keefe ok@REDACTED
Mon Jul 28 02:47:09 CEST 2008


It may be worth pointing out that Mercury has something rather like
this for "state" arguments threaded through predicates.
Also, functional language with explicit 'let' allow
	let val x = 1 in
	let val x = x + 1 in
	x+1 end end
(SML) or
	let x = 1 in
	let x = x + 1 in
	x+1
(Haskell).

I have learned to avoid this, because the result is that
when I come to *read* the code, I'm never quite sure which
x I am dealing with.  For some reason, the Mercury version
doesn't seem to have this problem, perhaps because Mercury
style is to use it for "imperative" things like I/O.













More information about the erlang-questions mailing list