On Sun, Nov 27, 2011 at 17:50, Michel Talon <talon at lpthe.jussieu.fr> wrote:
> ...I am not advocating modifying the definition of := (except eventually in
> private work). This being said, i have checked that the "function" concept
> in
> maxima and in maple work exactly the same, so one can safely say this is
> the
> standard way of doing things.
Well, yes, this is the standard way that (almost?) all programming
languages do things. Defining a subprogram's body dynamically, based on a
calculation, if possible at all, is treated as the exceptional case. What
complicates things in Maxima (and other CAS's) is that it blurs the line
between subprograms (programming functions) and mathematical functions.
Maple's proc syntax is essentially the lambda approach I was mentioning,
except that Maxima doesn't support mathematical operations on
lambda-expressions. This is partly because that approach is unfamiliar to
most users of mathematics (mathematicians, physicists, engineers, ...). On
the other hand, I see that Maple has some peculiar rules for evaluating the
name 'f'.
Gerry Sussman uses a Scheme-based notation with explicit functions like
this in his Structure and interpretation of classical
mechanics<http://books.google.com/books?id=H_6Ux04cPv8C>
*, *but as far as I know, this has not been taken up by the physics
community.
-s
> f evaluates to the name f;
>
> eval(f) yields the actual procedure structure;
>
> op(eval(f)) yields the sequence of eight operands mentioned above (any or
> all of which may be null).
>
> - A procedure assigned to f is invoked by using f(arguments). See
> parameters
> for an explanation of parameter passing. The value of a procedure
> invocation
> is the value of the last statement executed, or the value specified in a
> return statement.
>
> - Remember tables (option remember) should not be used for procedures that
> are
> intended to accept mutable objects (e.g., rtable) as input, because Maple
> does
> not detect that such an object has changed when retrieving values from
> remember tables.
>
> I think that procedures with option remember are the same thing as array
> functions in maxima parlance.
>
>
>
>
>
> --
> Michel Talon
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>