On 2012-08-10, Dennis Darland <dennis.darland at yahoo.com> wrote:
> Compiling I get many warnings about undefined variables. As I
> understand it 'define variable' defines global variables. Many of the
> variables I got warnings for I would not want to be global. Is there
> a way to define local variables?
Well, as far as I know, the Maxima to Lisp translator complains about
variables which are neither function arguments nor local variables (as
in block([a, b, c], ...)). If you are getting complaints about such
variables, that seems like a bug. If you would provide examples it would
be helpful.
> Others are arrays. The arrays worked as global OK when the code was
> being interpreted. I could not figure how to define arrays in
> define_variable either.
There is something about arrays in the mode_declare documentation, but I
don't know to what extent the translator actually exploits that
information.
> Also, the code ran even with the warnings, but was no faster.
Not too surprising.
The long and the short of it is that Maxima is something of a mess as a
programming language. You will probably be less frustrated if you think
of programming in Maxima as more of an empirical exercise than logical.
FWIW
Robert Dodier