Tag Info

New answers tagged

1

This is undocumented so I don't know how stable it is. But worth to point this out. SetAttributes can work on strings if those strings are representing symbols that were already created. Which is usually the case after running a package. moreover, those symbols don't have to have any type of value, just need to be created when read. The point is, you ...


1

I think that you can just do a Get[] or Needs[] to load the package...BTW test this without .NetLink first to make sure you have the directory issues figured out After your package is loaded, you should be able to evaluate SecondDegre[] just like accessing functions inside packages from inside Mma. Ref: ...


4

This isn't a problem you should try to solve automatically. Use good code hygiene and make sure you don't call private functions. You should (aim to) understand your code well enough that you don't get surprises like this --- you wrote it, and you know it better than anyone else. If there are surprises even to you, how will anyone else understand it?! ...


1

You could use Condition /; with your predefined tests on definition of new symbols and functions within your package. So the definition of a Symbol is only loaded, if the test yields True. Add a message if the test goes wrong. Maybe this is what you are looking for: BeginPackage["MusicTools`"]; note::usage = "a note"; noteQ::usage = "test for a note"; ...


2

Being able to use this provides us with a way to produce quite secure CDFs designed for FreePlayer. Maybe it is a problem with encoding somewhere or with overloaded definitions of Get. Nevermind, as pointed out by Rolf Mertig if one uses OpenRead with DefineInputStreamMethod to convert a binary file to a stream, everything seems to work. Steps: ...


2

General Some time ago, I wrote a package specifically to address this issue. It is named PackageManipulations and described in this post. The package can be imported as Import["http://www.mathprogramming-intro.org/download/packages/PackageManipulations.m"] It has an accompanying notebook with detailed explanations of how to use it, but I will give a ...


5

From the comments: But I'm mainly worried about the warning messages that Mathematica issues when I load both packages. If the packages are properly written, and if the symbol conflict is between two packages (and not builtins and a package function), then you can safely ignore it. From the documentation of BeginPackage: BeginPackage["context`"] ...


2

A bit long for a comment but here goes. I will suggest using a wrapper function that "adapts" other functions to the version-10-vs-earlier environments. Something like this maybe. SetAttributes[version10PlusHandler, HoldAll]; version10PlusHandler[func_] := If[$VersionNumber < 10, func ,(*else*) Module[{opts}, Internal`WithLocalSettings[ ...


1

Here is a way of computing the result that you seek. Define the operators. I have used a convention in which upper/lower indices are given as first/second arguments. Clear[op1, op2] op1[mu_, nu_, alf_, bet_] := -p^2 (eta[{mu, alf}, {}] eta[{nu, bet}, {}] + eta[{mu, bet}, {}] eta[{nu, alf}, {}] - eta[{mu, nu}, {}] eta[{alf, bet}, {}]) ...


0

The main problem is that init.m file is different for Mathematica and Players: expr = Dynamic[Column[{ FileNameDrop[#, 3], Import[#, "Text"] }] &@FileNameJoin[{$UserBaseDirectory, "Kernel", "init.m"}]]; CDFDeploy[ FileNameJoin[{$TemporaryDirectory, "userbasedirectory.cdf"}], expr, Method -> "Standalone"] SystemOpen @ % ...



Top 50 recent answers are included