1

Which packages do you know of, that have the following properties:

  • using custom notation (for input AND output would be preferable)
  • well coded & designed (from your subjective perspective!)
Mr.Wizard
  • 271,378
  • 34
  • 587
  • 1,371
NoEscape
  • 842
  • 4
  • 14

3 Answers3

8

I'm not going into the well-coded part of your question (as this is rather subjective), but a package that I've (cursorily) examined and which looks nice is this quantum notation package, which has lots of custom notation and corresponding palettes.

enter image description here

Sjoerd C. de Vries
  • 65,815
  • 14
  • 188
  • 323
6

Besides the quantum package already mentioned by @Sjoerd, the package with the most customized notation that I know of is the THEOREMA package. You can freely use the package and admire the complex logicographics notation created, but the code is not available for inspection.

Finally, the OP leaves me No-Escape (pun intended) but to mention my WildCats category theory package which is perhaps a unique example of 3rd party package using the standard Notation package together with some hand-made (MakeExpression, etc.) custom notation. You can inspect my code.

Dr. belisarius
  • 115,881
  • 13
  • 203
  • 453
magma
  • 5,290
  • 24
  • 46
  • Now that is a good counterexample for "well coded". No offence here, but putting everything, even an image into a single .m file is against one of the top 10 coding rules. No documentation in the code is another weakness, making it impossible to read. – NoEscape Oct 18 '12 at 06:29
  • My comment was about WildCats, your own package. We really need a "Best Pratices for package programming" question... – NoEscape Oct 18 '12 at 16:44
  • 9
    @NoEscape, I think that's a little unfair. The .m file is autogenerated from a notebook, which may contain extensive comments. There's no real motivation for the developer to put (* *) comments into the code cells just so they appear in the .m file. Given that the package includes 13 tutorials and 135 symbol reference pages there is hardly a lack of documentation. The source notebook may also be split into sections and subsections, so the fact that a single .m file is produced is no reflection on how well the code is structured. – Simon Woods Oct 18 '12 at 20:05
  • 1
  • 3
    @Simon has perfectly well expressed my point :-). On the other hand - experimenting with the OP characteristic diplomatic writing style - it might be said that , if one needs comments to understand my code, than perhaps he/she needs to read Wolfram's book and some category theory first. No offense here :-) Anyway...prior releases of WildCats indeed also included the much more friendly .nb file . – magma Oct 19 '12 at 10:48
  • @NoEscape The doc notebooks include 10's of embedded images. If you have any complaint....talk to WRI. – magma Oct 19 '12 at 11:05
  • 1
    OK. It is well coded and working, but hardly readable. This is a fundamental problem of autogenerated packages! – NoEscape Oct 20 '12 at 05:36
  • 2
    @NoEscap WildCats is created with Workbench, but I use the internal MMA editor, so I make a heavily commented/sectioned .nb file. The autogenerated .m file is for deployment only. – magma Oct 21 '12 at 09:50
  • @magma: Which one is the source file then? – Mechanical snail Dec 08 '12 at 01:04
  • @Mechanicalsnail the .m file is the source that is made available for download. – magma Dec 08 '12 at 01:23
  • 1
  • @NoEscape While I haven't worked with the Notations package, I would assume that it practically makes it necessary to use notebooks (and not .m files) for development because it deals with "2D notation". That also implies that the generated .m file will be messy, but that doesn't matter because that's not what the developer is working with. – Szabolcs Jan 11 '16 at 12:04
  • I do agree with @Mechanicalsnail's point though that with this development model not having access to the source notebook practically forbids either modifying or inspecting the code ... is that compatible with the GPL? I'm not sure and I really don't want to go into that argument (not a GPL fan anyway). – Szabolcs Jan 11 '16 at 12:05
4

I suggest those two tutorials for writing Mathematica packages, unfortunately the first one is in Spanish, yet I do believe it will be useful for anyone because the step-by-step images; the second one is in English.

Renan
  • 731
  • 9
  • 21
MaTECmatica
  • 588
  • 4
  • 12