Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

8
  • $\begingroup$ Declare Global`x1 in between BeginPackage[] and Begin[], and try again. $\endgroup$ Commented May 10, 2016 at 10:13
  • 1
    $\begingroup$ @SimonRochester while linked topic is older I'd make it a duplicate of this one. It is because the answer here is more general. Sorry but your solution requires to clear the kernel, before loading a package, to avoid shadowing problems with all exported dummy symbols (here x). Not to mention that if two packages export x the shadowing will be unavoidable. $\endgroup$ Commented Dec 22, 2016 at 10:45
  • $\begingroup$ @Kuba I am inclined to agree, but I never like closing older questions as duplicates of newer ones. That doesn't mean I won't do or allow it, it's just how I feel about it. One alternative that comes to mind is to merge these questions which would move your more general answer to the older question; this would "cost" you an Accept but it would juxtapose your method and caveats with the seemingly simpler approach shown in Simon's answer. $\endgroup$ Commented Dec 22, 2016 at 17:13
  • 1
    $\begingroup$ @Mr.Wizard I'm fine with that, feel free to merge :) $\endgroup$ Commented Dec 22, 2016 at 17:37
  • $\begingroup$ @Kuba I will wait 24 hours in case anyone has an objection or wishes to reopen this question as a Merge is impossible to reverse without SE developer intervention. (please remind me if I forget) $\endgroup$ Commented Dec 22, 2016 at 17:38