1
$\begingroup$

I have noticed the following weird behavior when creating Private Context in V 10.0.1, a behavior not present in V 10.0.0.

$Context
"Global`"
BeginPackage["testing`"]
"testing`"
$Context
"testing`"

Now we create a Private sub-context

Begin["`Private`"]
testing`Private`

Everything looks good so far until this:

$Context
"testing`Private`Private`"

So instead of being in the testing`Private sub-context, Mathematica has entered a sub-sub-context.

I've verified this on Windows and Linux. Can anyone verify this behavior in V10.0.1?

$\endgroup$
  • $\begingroup$ It seems that I cannot reproduce this behavior in 10.0.1 under Windows 7. Do you have any kind of $PreRead etc. that would cause Begin["`Private`"] to be evaluated twice? $\endgroup$ – Mr.Wizard Oct 4 '14 at 16:28
  • $\begingroup$ Neither can I, Mac OS X. Chances are that you executed Begin["`Private`"] twice. $\endgroup$ – Leonid Shifrin Oct 4 '14 at 16:30
  • $\begingroup$ @Mr.Wizard. I just tested again, I have nothing in $PreRead or any System symbols. And I did not execute Begin["`Private`"] twice. $\endgroup$ – RunnyKine Oct 4 '14 at 16:35
  • $\begingroup$ $PreRead is not the only way something might be evaluated twice. Try adding -noinit to your launch arguments in Kernel Properties, and test the evaluation in a blank Notebook. $\endgroup$ – Mr.Wizard Oct 4 '14 at 16:38
  • $\begingroup$ @Mr.Wizard. How do I get to this Kernel Properties you speak of? I can't seem to find it. $\endgroup$ – RunnyKine Oct 4 '14 at 16:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.