Timeline for Creating Mathematica packages
Current License: CC BY-SA 3.0
13 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 23, 2017 at 12:35 | history | edited | CommunityBot | replaced http://stackoverflow.com/ with https://stackoverflow.com/ | |
| Nov 3, 2014 at 18:05 | comment | added | Leonid Shifrin | @QuantumDot Also, all files should be in the same folder. Loading happens using Kernel/init.m, as usual. Available since v10. | |
| Nov 3, 2014 at 18:02 | comment | added | Leonid Shifrin | @QuantumDot [2/2] all of them should start with the same declaration Package[main-context]. It is not necessary to declare private sub-contexts, symbol localization happens automatically (you only have to specify exported and package-scope symbols). Declarations PackageExport and PackageScope can be anywhere in the file. You only have to declare such symbols once, in any of the files which uses / defines them. Private symbols in different files don't collide with each other (live in different sub-contexts when resolved). | |
| Nov 3, 2014 at 18:00 | comment | added | Leonid Shifrin | @QuantumDot [1/2] The best way is to use the new package format. It has not been documented however. Very briefly, Package[context] - starts the package, no need to end it with any statement (no EndPackage needed).PackageImport[context] - analog of Needs PackageExport[String-name-of-symbol] - exports a given symbol as public. PackageScope[String-name-of-symbol] - makes it possible to share the symbol between several files of the same package. All other symbols are considered file-private (not just package-private). All files are parts of the same package (share main context), so ... | |
| Nov 3, 2014 at 13:52 | comment | added | QuantumDot | I have organized my package into three sub-packages. These sub-packages use share/use some common functions (but are not intended to be used by the user). Do you know how to make some functions public to the sub-packages, but not to the user? | |
| Jul 28, 2013 at 6:31 | history | migrated | from stackoverflow.com (revisions) | ||
| Jul 9, 2011 at 14:43 | vote | accept | jmlopez | ||
| Jul 9, 2011 at 14:32 | comment | added | jmlopez | @TomD, I have tested what Park said, I indeed needed this piece of undocumented code in the PacletInfo.m file under Extensions: {"Kernel", "Context"->{"SimpleArithmetic'Addition'","SimpleArithmetic'Product'"}}. Now that that's resolve I can simply things by a lot. | |
| Jul 9, 2011 at 14:18 | comment | added | jmlopez | @TomD, I think David Park's explanation is what I needed. Thank you. | |
| Jul 9, 2011 at 11:00 | comment | added | user1066 | David Park's reply to this message is also very informative. (A new version of DP's Presentations package for Mma 8 is now available, BTW) | |
| Jul 9, 2011 at 10:49 | comment | added | user1066 | @jmlopez. Mr. Wizard's reply to this question may be of interest | |
| Jul 9, 2011 at 9:23 | comment | added | jmlopez | thank you for taking the time to explain this important topic. I think I got this part covered. I'll be waiting for your update. What I really want is to know how to use SimpleArithmetic'Addition' and SimpleArithmetic'Product'. So far I can sort of do this but I always end up messing the links to the documentation I write. I could make everything as part of one whole package (documentation and package works) but I think it is very important to know how add subsidary packages to the application that work with the documentation. | |
| Jul 9, 2011 at 8:52 | history | answered | Leonid Shifrin | CC BY-SA 3.0 |