The following doesn't work:
Lol[x_, y_] = Module[ {w=x+1, z = w + 1}, z]
because z
refers to w
. Is there a way to make it so that variable definitions within Module
can refer to other variable definitions?
This is similar to let
constructs in other languages.
Lol[x_, y_] := Module[{w, z}, w = x + 1; z = w + 1]
$\endgroup$