@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/function.texi,v 1.2 1999/12/21 02:47:33 noro Exp $ \BJP @node 函数に対する操作,,, 組み込み函数 @section 函数に対する操作 \E \BEG @node Operations on functions,,, Built-in Function @section Operations on functions \E @menu * functor args funargs:: @end menu \JP @node functor args funargs,,, 函数に対する操作 \EG @node functor args funargs,,, Operations on functions @subsection @code{functor}, @code{args}, @code{funargs} @findex functor @findex args @findex funargs @table @t @item functor(@var{func}) \JP :: @var{func} の函数子を取り出す. \EG :: Functor of function form @var{func}. @item args(@var{func}) \JP :: @var{func} の引数リストを取り出す. \EG :: List of arguments of function form @var{func}. @item funargs(@var{func}) \JP :: @code{cons(functor(@var{func}),args(@var{func}))} を返す. \EG :: @code{cons(functor(@var{func}),args(@var{func}))}. @end table @table @var @item return \JP @code{functor()} : 不定元, @code{args()}, @code{funargs()} : リスト \EG @code{functor()} : indeterminate, @code{args()}, @code{funargs()} : list @item func \JP 函数形式を表す不定元 \EG function form @end table @itemize @bullet \BJP @item 函数形式に関しては, @code{vtype()} を参照. @item 函数形式 @var{func} の函数子, 引数リストを取り出す. @item 逆に, 取り出した函数子を値に持つプログラム変数を @code{F} とすれば (@code{*F})(x) で x を引数とする函数呼び出しまたは函数形式が入力できる. \E \BEG @item @xref{vtype} for function form. @item Extract the functor and the arguments of function form @var{func}. @item Assign a program variable, say @code{F}, to the functor obtained by @code{functor()}. Then, you can type (@code{*F})(x) (, or (@code{*F})(x,y,...) depending on the arity,) to input a function form with argument x. \E @end itemize @example [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 @end example @table @t \JP @item 参照 \EG @item References @fref{vtype}. @end table