@zenterix There is a distinction that must be made between declarations and statements, although that distinction has been fading over the years. In a module, the declarations must come before the statements. All of these are declarations:
local defaultSeed:= 100;
export getSeed:= ()-> defaultSeed;
But this is a statement:
Your error is that you have an export declaration after the above statement.
By combining the declaration of the names and the assignment of their (initial) values, it's possible to write useful modules that are all declarations, no statements. The majority of modules that I write are like that, as is the example that I gave.
For reasons that I don't understand, I seem to be the only one who does it this way. One benefit is that you don't need to retype (and possibly misspell) the variable name.
The reserved words local and export only need to be used once, each followed by a comma-separated sequence of variables with their initial values (exactly like the example I showed). I always do it that way. Sure, you can put local or export in front of every variable, but why would I type any word more than once if I don't need to?
- One thing you might note is that I am literally trying to learn about Maple from the official documentation. I simply use what is there. Initially I was reading Chapter 8 about Modules of the Programming Guide....
Likewise, my entire knowledge of Maple comes from reading the official documentation (including the Programming Guide), this forum, the fora that existed before this, and experimentation. I haven't learned from any teachers or books about it. I've looked through many third-party books with Maple in the title, and I have many on my shelves. While most of these books do do a decent job of teaching whatever type of math they're trying to teach, their Maple content is appalling. The only exception that I've seen is Calculus the Maple Way by Robert B. Israel, who used to be a frequent contributor here.