64 views

I understand why $happens here: ClearAll[foo] foo[a_] := (x_ :> a x) foo[1] ... 5answers 2k views ### Enforcing correct variable bindings and avoiding renamings for conflicting variables in nested scoping constructs Using global variables the following turns an "expression" into a Function: expr = 2 x; Function[x, Evaluate[expr]] Of course ... 2answers 2k views ### Scraping High-Res images from the MoMA and the Van Gogh Museum websites Many art websites allow the user to zoom into an image to see it at high resolution by using image tiles. It is great on the website, but presents problems if one wishes to compile a complete high ... 1answer 856 views ### Is the renaming mechanism of With flawed? I'm confused about the renaming mechanism of With: ... 2answers 1k views ### I define a variable as local to a module BUT then the module uses its global value! Why? I have a question about modules and local variables. Here's my example: h = 5; Module[{a, h}, a[h_]= h^2; a[4]] (*Out[2] = 25*) I expected the module to ... 1answer 443 views ### StringReplace, ReplaceAll and Rule interact in a bizarre way I have the following pair of things: ClearAll[foo, labeledFoo]; labeledFoo = {"FooBarBazQuux", foo}; This works like you'd expect: ... 0answers 345 views ### Exhaustive examples of variable replacement due to nested scoping constructs Consider the following examples, where I have replaced dollar signs in the output by a D. ... 1answer 104 views ### Scoping problem? [duplicate] Why (f[1, 0] /. {x : 0 | 1 :> 1 - x}) -> 0 returns (expectedly) f[0, 1] -> 0, while ... 1answer 71 views ### Inconsistent application of replacement rule I want to use a replacement rule to change log[var] into var inside a function. A minimal example follows. In one case it ... 0answers 131 views ### Why does … := With[{var = …}, …] create var$?

EDIT This issue is specifically different from the "duplicate" question. The creation of variables in the active context during parsing is of no surprise and is the expected behavior. What I'm ...