|
From: Arthur N. <ac...@ca...> - 2016-04-20 20:52:54
|
On Wed, 20 Apr 2016, Kostas Oikonomou wrote:
> Is there some way to have Reduce procedures have optional
> arguments/parameters, or arguments/parameters with default values?
> Right now I have to declare all such variables global in my user-mode
> Reduce program.
>
> Kostas
>
Standard Lisp does not provide optional arguments or default values as a
capability, so at that level of abstraction the answer is no.
Apart from the fact that a Lisp-level macro definition can cope...
But at the level of the algebraic interface that the ordinary user works
with then observe commands like for instance "plot" or even "df" that can
take variable numbers or arguments, as can a whole bunch of other things,
so it how you set up the way that something will get simplified. If you go
put('myname, 'simpfn, 'simpmyname)
then when the user goes myname(... args ...) the function simpmyname gets
a list of all of the args, so you can check its length and do whatever you
like...
Arthur
|