[BACK]Return to function.texi CVS log [TXT][DIR] Up to [local] / OpenXM / src / asir-doc / parts / builtin

File: [local] / OpenXM / src / asir-doc / parts / builtin / function.texi (download)

Revision 1.2, Tue Dec 21 02:47:33 1999 UTC (24 years, 6 months ago) by noro
Branch: MAIN
CVS Tags: maekawa-ipv6, RELEASE_20000124, RELEASE_1_2_1, RELEASE_1_1_3, RELEASE_1_1_2
Changes since 1.1: +34 -7 lines

Now 'asir-doc' can produce both English and Japanese versions of
manuals, help files and HTML files. See README for detail.
Though Takayama-san's effort to enhance 'oxweave', it is still
difficult to use it as is for 'asir-doc', so currently 'extract_man.c'
is used to extract manual sources for a specific language.

@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/function.texi,v 1.2 1999/12/21 02:47:33 noro Exp $
\BJP
@node $BH!?t$KBP$9$kA`:n(B,,, $BAH$_9~$_H!?t(B
@section $BH!?t$KBP$9$kA`:n(B
\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,,, $BH!?t$KBP$9$kA`:n(B
\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} $B$NH!?t;R$r<h$j=P$9(B. 
\EG :: Functor of function form @var{func}.
@item args(@var{func})
\JP :: @var{func} $B$N0z?t%j%9%H$r<h$j=P$9(B. 
\EG :: List of arguments of function form @var{func}.
@item funargs(@var{func})
\JP :: @code{cons(functor(@var{func}),args(@var{func}))} $B$rJV$9(B. 
\EG :: @code{cons(functor(@var{func}),args(@var{func}))}.
@end table

@table @var
@item return
\JP @code{functor()} : $BITDj85(B, @code{args()}, @code{funargs()} : $B%j%9%H(B
\EG @code{functor()} : indeterminate, @code{args()}, @code{funargs()} : list
@item func
\JP $BH!?t7A<0$rI=$9ITDj85(B
\EG function form
@end table

@itemize @bullet
\BJP
@item
$BH!?t7A<0$K4X$7$F$O(B, @code{vtype()} $B$r;2>H(B. 
@item
$BH!?t7A<0(B @var{func} $B$NH!?t;R(B, $B0z?t%j%9%H$r<h$j=P$9(B. 
@item
$B5U$K(B, $B<h$j=P$7$?H!?t;R$rCM$K;}$D%W%m%0%i%`JQ?t$r(B @code{F} $B$H$9$l$P(B (@code{*F})(x) $B$G(B
x $B$r0z?t$H$9$kH!?t8F$S=P$7$^$?$OH!?t7A<0$,F~NO$G$-$k(B. 
\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 $B;2>H(B
\EG @item References
@fref{vtype}.
@end table