开发者

Building Application Packages with multple packages and references in Mathematica

I am building an application package in Mathematica. The application contains multiple packages and refers to other application packages

To set everything up, I have used and followed the application packages instructions of the help section of workbench which is also available at:http://reference.wolfram.com/workbench/index.jsp?topic=/com.wolfram.eclipse.help/html/tasks/applications/introduction.html under the Packages and Applications subsection but...

  1. I have implemented and tested single package application packages and the all seem to work fine.
  2. My Multiple packages and application is not working fine at this moment because of the following identified problems: a) the main package of the application calls functions implemented in the extra packages, but these function seem not to be recognized there. I have tried even to explicitly call them in the main package using the Needs command at the beginning of the package with 开发者_如何学运维no avail. *What am I doing wrong?*The extra packages are all in the application folder as the help directs to do. More specifically:

The main package and the application are named OptMainFuncAll` so the main package OptMainFuncAll.m begins with

BeginPackage["OptMainFuncAll`"]

The extra packages IntermFunct.m and VolCandExt.m begin with:

BeginPackage[ "OptMainFuncAll`IntermFunct`"]
BeginPackage[ "QuadOptMainFuncAll`VolCandExt`"]

Yet functions defined in IntermFunct.m and VolCandExt.m are are unknown when called for in OptMainFuncAll.m -- What am I doing wrong?

Ihave even tried explicitly declaring

Needs[ "OptMainFuncAll`IntermFunct`"]
Needs[ "QuadOptMainFuncAll`VolCandExt`"] 

at the beginning of OptMainFuncAll.m and it has not solved my problem

In addition I have made a reference to a second application package (BasicSym )and workbench shows it as referenced, but its functions also seem unknown in OptMainFuncAll.m .

I have also tried beginning OptMainFuncAll.m with

  BeginPackage[{OptMainFuncAll`, BasicSym`}]

and it did not work; the console at run times returns the message:

BeginPackage::cxt: Invalid context specified at position 1 in BeginPackage[{OptMainFuncAll, BasicSym}]. A context must consist of valid symbol names separated by and ending with `. EndPackage::noctx: No previous context defined.

I am sure I am making some stupid application package developer mistake, but I can't seem to put my hand on it.

If you can just tell me the exact package declarations in BeginPackage[?] for the main package, the extra packages and the referenced packages with the names I provided here for everything to work smoothly, i'd greatly appreciate.


Please Try:

BeginPackage["OptMainFuncAll`",
      {"BasicSym`",
       "OptMainFuncAll`IntermFunct`",
       "QuadOptMainFuncAll`VolCandExt`"}
]

The current package name is the first argument, while the second argument is a list of package names (contexts) that it will depend upon.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜