version 1.3, 2002/09/03 01:50:59 |
version 1.5, 2003/12/20 20:05:02 |
|
|
@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/function.texi,v 1.2 1999/12/21 02:47:33 noro Exp $ |
@comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/function.texi,v 1.4 2003/04/20 08:01:28 noro Exp $ |
\BJP |
\BJP |
@node $BH!?t$KBP$9$kA`:n(B,,, $BAH$_9~$_H!?t(B |
@node $BH!?t$KBP$9$kA`:n(B,,, $BAH$_9~$_H!?t(B |
@section $BH!?t$KBP$9$kA`:n(B |
@section $BH!?t$KBP$9$kA`:n(B |
|
|
\E |
\E |
|
|
@menu |
@menu |
|
* call:: |
* functor args funargs:: |
* functor args funargs:: |
@end menu |
@end menu |
|
|
|
\JP @node call,,, $BH!?t$KBP$9$kA`:n(B |
|
\EG @node call,,, Operations on functions |
|
@subsection @code{call} |
|
@findex call |
|
|
|
@table @t |
|
@item call(@var{name}, @var{args}) |
|
\JP :: $BH!?t(B @var{name} $B$r8F$S=P$9(B. |
|
\EG :: Call the function @var{name} with @var{args}. |
|
@end table |
|
|
|
@table @var |
|
@item return |
|
\JP $BH!?t(B @code{name()} $B$NJV$jCM(B. |
|
\EG a return value of @code{name()}. |
|
@item name |
|
\JP $BH!?tL>$rI=$9ITDj85(B($BH!?t;R$H$O8B$i$J$$(B) |
|
\EG indefinite (function name) |
|
@item args |
|
\JP $B0z?t$N%j%9%H(B |
|
\EG a list of arguments |
|
@end table |
|
|
|
@itemize @bullet |
|
\BJP |
|
@item |
|
$BH!?t;R$K4X$7$F$O(B, @code{vtype()} $B$r;2>H(B. |
|
@item |
|
$B0z?t$N8D?t$,$"$i$+$8$aJ,$+$C$F$$$k$H$-$O(B @code{(*@var{name})()} $B$N7A<0(B, |
|
$BJ,$+$i$J$$$H$-$O(B @code{call()} $B$r;H$&$H$h$$(B. |
|
\E |
|
\BEG |
|
@item |
|
See @ref{vtype} for function form. |
|
\E |
|
@end itemize |
|
|
|
@example |
|
[0] A=igcd; |
|
igcd |
|
[1] call(A,[4,6]); |
|
2 |
|
[2] (*A)(4,6); |
|
2 |
|
@end example |
|
|
|
@table @t |
|
\JP @item $B;2>H(B |
|
\EG @item References |
|
@fref{vtype}. |
|
@end table |
|
|
\JP @node functor args funargs,,, $BH!?t$KBP$9$kA`:n(B |
\JP @node functor args funargs,,, $BH!?t$KBP$9$kA`:n(B |
\EG @node functor args funargs,,, Operations on functions |
\EG @node functor args funargs,,, Operations on functions |
@subsection @code{functor}, @code{args}, @code{funargs} |
@subsection @code{functor}, @code{args}, @code{funargs} |
|
|
[x] |
[x] |
[0] funargs(sin(3*cos(y))); |
[0] funargs(sin(3*cos(y))); |
[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)));@} |
[1] for (L=[sin,cos,tan];L!=[];L=cdr(L)) @{A=car(L); |
|
print(eval((*A)(@@pi/3)));@} |
0.86602540349122136831 |
0.86602540349122136831 |
0.5000000002 |
0.5000000002 |
1.7320508058 |
1.7320508058 |