Why would Mathematica break normal scoping rules in Module?
- by Davorak
As was pointed out in a recent post scoping does not work as expected inside of Module.
An example from that thread is:
Module[{expr},
expr = 2 z;
f[z_] = expr;
f[7]]
(*2 z$1776*)
But the following works as almost as expected.
Module[{expr},
expr = 2 z;
Set@@{f[z_], expr};
f[7]]
(*14*)
What language design consideration made wolfram choose this functionality?