Google

Go to the first, previous, next, last section, table of contents.


functor, args, funargs

functor(func)
:: Functor of function form func.
args(func)
:: List of arguments of function form func.
funargs(func)
:: cons(functor(func),args(func)).
return
functor() : indeterminate, args(), funargs() : list
func
function form
  • See section vtype for function form.
  • Extract the functor and the arguments of function form func.
  • Assign a program variable, say F, to the functor obtained by functor(). Then, you can type (*F)(x) (, or (*F)(x,y,...) depending on the arity,) to input a function form with argument x.
[0] functor(sin(x));
sin
[0] args(sin(x));
[x]
[0] funargs(sin(3*cos(y)));
[sin,3*cos(y)]
[1] for (L=[sin,cos,tan];L!=[];L=cdr(L)) {A=car(L); print(eval((*A)(@pi/3)));}
0.86602540349122136831
0.5000000002
1.7320508058
References
section vtype.


Go to the first, previous, next, last section, table of contents.