Unclear what you have in mind. You can define a maxima
function with a variable number of arguments, all evaluated,
this way:
f([x]) := x /* note the [x] */
try f(a,b,c);
To get pieces out of this x, use part, inpart, subscripting, first, rest
etc.
If you want to access from lisp, you should be able to do
(elt $x 0 ) --> (mlist simp)
(elt $x 1) --> $a
etc.
At the time Macsyma was first being written, there were many ways
of defining functions with different argument evaluation techniques.
These techniques were expr (the usual), fexpr, lexpr, and some
others. These may still be in macsyma as
mexpr, mfexpr, and perhaps some other variations.
Esssentially all these other variants were incorporated in
common lisp in other ways, including &rest arguments, and defmacro.
There are also ways of defining macros using buildq which I heartily
DISrecommend using.
If you wish to have a common lisp function that takes a variable
number of arguments I suggest you try
(defun f(&rest x) x) ;;; x is a list of the arguments, evaluated.
RJF
Dan Stanger wrote:
> It seems that when a function is called, that variable are accesable
> using a function or macro
> called arg i, where i is the arg number. Can someone tell me where this
> is defined, and
> if I have a variable number of args, how the best way of accessing them
> from lisp is?
> Is a loop collecting the rest of the args a good idea or ar the args
> collected already in a list somewhere?
> Is there some documentation on this?
> Dan Stanger
>
> _______________________________________________
> Maxima mailing list
> Maxima@www.math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>