Tag Info

New answers tagged

1

I have exactly the same project. In my case paramList always has the same variables' names, so I defined a "structure" to handle it in the package and a way to transform it into a rule: BeginPackage["foo`"] Unprotect @@ Names["foo`*"]; ClearAll @@ Names["foo`*"]; f::usage = "sol=f[x,plist]" Begin["`Private`"] constructPData[y_, z_] := pData[y, z]; pData /: ...


1

I'm still not sure whether I understand your problem and what you are trying to achieve but I now found something which is not entirely obvious. I think you try to load a sub-package file which was encoded with a key and put its context on $ContextPath. Here is what I think will do what you want: First you need a directory TestApplication in one of the ...


1

I think you're confused about context paths, partly because your application only has one package. I assume you have a package called TestPackage.m located in a folder called TestApplication located within FileNameJoin[{$UserBaseDirectory, "Applications"}]? On my machine this folder would be ...


2

(this is wiki answer, as just noticed it is duplicate, but will keep it here for easy reference) The result is different from Version 2.2 and version 10.1, this is just to show the difference. Something changed between 1993 and today:


6

It seems that when the book appeared, the behaviour of how a symbol is resolved was different. We have two important things: the current $Context which is usually Global` unless you change it with e.g. Begin as you did the $ContextPath which is a list of contexts that are searched when you type in a symbol like x without explicit context Now there seems ...


0

No erratic behavior on my computer M9. However a simple workaround could be considered that achieves its purpose. Workaround for moving a symbol from one context to another can be achieved by: For example, create symbol in the context Global and move it to foo` x = 1; (*create x in Global` *) foo`x = x; (*create x in foo` and ...


3

It is hard to answer you without you showing a minimal example of the problem. But my guess is that you are making the mistake of returning symbols from the package back to the user. The way to handle these things, is to do like all Mathematica functions do, which is pass the symbols needed in the call itself. For example, when using DSolve or Integrate, ...


17

In version 10.1, I've built something like Spelunk into GeneralUtilities`. To use it, run Needs["GeneralUtilities`"] PrintDefinitions[symbol]; This will pop up a window that shows all definitions of symbol. Here is a short summary of features: The window shows code cells containing all DownValues, OwnValues, UpValues, SubValues, and Attributes of a ...



Top 50 recent answers are included