greatpet

30 Reputation

One Badge

0 years, 291 days

MaplePrimes Activity


These are replies submitted by greatpet

@acer Suppose the main module is in the plain text file main.mpl, and a local procedure is in proc1.mpl. Then I add $include "proc1.mpl" inside main.mpl. But I want to load main.mpl from a Maple worksheet in another directory, by read("file_path/main.mpl"). Now this will cause an error, because main.mpl will be looking for proc1.mpl in the current working directory of the worksheet, rather than the directory that contains both main.mpl and proc1.mpl. What's a good way around this problem? For example setting up a default directory for $include, by some environment variable?

@acer My procedures are already in a module, so I'll just unnest the inner procedure and move it into the module itself. The minor annoyance is that the source file for the module will contain more top-level procedures, which somehow affects readability from my perspective, but this is no worse than the analogous situation in C programming.

@Carl Love I just had a chance to come back to this project, thanks for the interesting code! I learned several new things about Maple programming by understanding your code.

Incidentally, Wolfram Mathematica's version of applyrule (ReplaceAll) can actually get the job done, because it understands commutativity of multiplication.

Page 1 of 1