Skip to main content
added results
Source Link
Chris K
  • 20.4k
  • 3
  • 39
  • 75

Try

replace[rules_] := ReplaceAll[Global`var, rules]

in your function. Then

replace[var -> 0]
replace[Test`Private`var -> 0]

yields

0
var

as I think you'd like.

Try

replace[rules_] := ReplaceAll[Global`var, rules]

in your function.

Try

replace[rules_] := ReplaceAll[Global`var, rules]

in your function. Then

replace[var -> 0]
replace[Test`Private`var -> 0]

yields

0
var

as I think you'd like.

Source Link
Chris K
  • 20.4k
  • 3
  • 39
  • 75

Try

replace[rules_] := ReplaceAll[Global`var, rules]

in your function.