# Tag Info

5

In addition to Rolf's workaround. This is expected and works the same in V9 and V10. NotebookEvaluate / Details & Options: By default, NotebookEvaluate evaluates the cells of a notebook in the same way that Get evaluates the lines of a package file. Messages, print output, and other side effects will be placed as output to the cell that called ...

7

If you look at the definition of NotebookEvaluate, by means of Needs["GeneralUtilities"]; GeneralUtilitiesPrintDefinitions[NotebookEvaluate] you see that the design is strange: always $ParentLink is set to First@$FrontEnd, and the designer obviously never thought about your use case. However, it is easy to achieve what you want, just define e.g. ...

2

You can see what is going on by setting $FrontEndSession Evaluator->"LinkSnooper". Create a notebook (A) with two cells and evaluate them: SetOptions[$FrontEndSession, Evaluator -> "LinkSnooper"] $Context Create another (B) one with: SetOptions[EvaluationNotebook[], CellContext -> Notebook]$Context Let's clear LinkSnooper's console ...

1

This question is old but still of interest to me, so I will offer a solution to seek feedback for improvement. From Mathematica, we start by loading the large package (I assume you meant Mathematica library to be a package, but the solution for loaded library functions will be similar). We also record before changing the parent link, so we can return ...

24

Short answer The local variables of the form varname\$... are used by the system, and it is unwise to use symbols with such names as local variables. With, like many other lexical scoping constructs, performs excessive renamings, often even in cases where it isn't strictly necessary. This probably has to do with efficiency - full analysis may be more costly....

Top 50 recent answers are included