65 Reputation

One Badge

12 years, 184 days

MaplePrimes Activity

These are replies submitted by ianmccr


As an additional learning opportunity, your code provides a good example of how to use the document properties. I have skimmed the help pages for document tools and help tools previously, but their actual usefulness was not evident a.t the time. Now I get it!


I would have been really pleased if I had found this tutorial when I first searched for help on help.

@Joe Riel

Object encapsulation seems to be implemented in Maple in much the same way that it was done in Turbo Pascal, as opposed to C++ classes.  It seems to me that, ignoring multiple inheritance, you almost have object inheritance with the address operator(:-). Maybe you could simply tweak this operator or the rules by which Maple scopes names to get simple inheritance. 



Thank you. That makes sense. I couldn't find any mention in the help files for creating help.

@Mac Dude 

 No. I assumed that the changes to the help tools package in Maple 2018 might have caused a problem, but I'll give it a try and work through any necessary changes.  Thanks.

Ian McCreath



Thank you.  The type tests you suggested will make my procedure much more robust.

Ian McCreath

@Carl Love

And thus we come back to the basic problem of programming Maple in Windows. I was using the workbook mainly because it provided ready acess to the programming editor which is otherwise only available is the startup code area or the code edit areas of a worksheet. It would have been nice if the editor were available as a standalone application. 

Would you also advise breaking up a large body of code (in excess of 2000 lines) into separate linked modulesto make it more managable?

Thank you.

If my prior posts come across in the wrong way, I apologize. I am frustrated with this workbook problem and having a hard time describing what is going on. My earlier observation was a red-herring. I just noticed that you get two different menus in the Navigator. In one, "attach files" is an unavailable command, in the other "attach files" is available and works.  I thought I had the answer to my problem when I found this, but the real problem remains.

However, I have attached a zipfile of three pdfs of worksheets that illustrate my problem. The file Glyph2.pdf shows how I read my module into the worksheet. Using with to load the module, all of the exports are listed. But after a restart, using the packagetools install command, the modules listed exports do not include all of the exports in the source code, eg. the command DiracMatrices is in the first listing, not the second.

The file Glyph2removerestartcommand.pdf illustrates what happens when I remove the restart command. (I also closed Maple and deleted Glyph2 from my toolbox before I tried the reinstall.) Now Diracmatrices is present in the listing.

However, the file Untitled(2).pdf shows that the module, which is actually available from the toolbox, does not include the new exported procedures.

I really have no idea why  Packagetools seems to reinstall the old package.



@Carl Love 

According to the help topic, "Maple Workbook URI," the Workbook URI (Uniform Resource Identifier) is used to represent the identity and location of files within a Maple workbook or files residing inside another workbook in a given file directory.
A URI  would look like this:
              "exampleURI := "this:///MyCode.mpl""

At this time, I can't attach any files to a maple workbook file on my installation.




I had to change input and output to 2D math notation for extended typesetting to take effect. However, your advice solved the output problem.


I don't know how to edit the post to remove the upload, but if the monitors wish to remove it, I understand the concern. I am open to suggestions as to how I should present the question, but, fundamentally, I believe the problem is the result of the namespace in an installed package. The code itself is copied straight from the maple examples, and my worksheet repeats the examples given on the help page for the module's exports, but the results are different when installed.

@Carl Love 


Here's the zipped workbook.

@Carl Love 

Thank you. I'll try the inert multiplication. This saved me a lot of time trying to finesse the output.


Thank You.  I have played around quite a bit with the code that Carl posted. I think I finally have a feel  for how the execution paradigm works, enough that I can apply it myself I appreciate that quite a bit of Maple's power comes from the ability to return a procedure unevaluated, but the case of how to actually generate results doesn't leap out from the help examples or the programming guide.  The only reference in help that I can find is "special evaluation rules."  However, modifying "end proc" to "end proc() doesn't leap off the page unless considered in the light of the examples in this thread. Ian Thompson's book does touch on the subject, but lightly. I'm going to take a close look at your sample code in the same light. 

It is interesting to note that Help documents the use of the :- operator without the left operand as a means of calling the global instance of a procedure when there is a local instance of the same name. I recall this was actually used in some sample code (Quotient Field of the Polynomial Ring) in the Maple 8 programming guide, specifically  gcd:=(a,b)->:-gcd(a,b) .


You can't find yourself unless you first get lost.  With Carl's modifications to my worksheet, I can experiment a bit with the effects of changes to the code.  However, given our recent discussion, I am starting to wonder whether the procedure I store in the table can, in turn, make a call to another procedure defined elsewhere in the module. Are there any limitations on the complexity of the statement sequence of the stored procedure.

1 2 Page 1 of 2