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

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

Revision 1.3, Tue Dec 21 02:47:34 1999 UTC (24 years, 6 months ago) by noro
Branch: MAIN
CVS Tags: RELEASE_20000124
Changes since 1.2: +73 -15 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/string.texi,v 1.3 1999/12/21 02:47:34 noro Exp $
\BJP
@node $BJ8;zNs$K4X$9$k1i;;(B,,, $BAH$_9~$_H!?t(B
@section $BJ8;zNs$K4X$9$k1i;;(B
\E
\BEG
@node Strings,,, Built-in Function
@section Strings
\E

@menu
* rtostr::
* strtov::
* eval_str::
@end menu

\JP @node rtostr,,, $BJ8;zNs$K4X$9$k1i;;(B
\EG @node rtostr,,, Strings
@subsection @code{rtostr}
@findex rtostr

@table @t
@item rtostr(@var{obj})
\JP :: @var{obj} $B$rJ8;zNs$KJQ$($k(B. 
\EG :: Convert @var{obj} into a string.
@end table

@table @var
@item return
\JP $BJ8;zNs(B
\EG string
@item obj
\JP $BG$0U(B
\EG arbitrary
@end table

@itemize @bullet
\BJP
@item
$BG$0U$N%*%V%8%'%/%H(B @var{obj} $B$rJ8;zNs$KJQ$($k(B. 
@item
$B@0?t$J$I$rJ8;zNs$KJQ49$7$FJQ?tL>$H7k9g$9$k$3$H$K$h$j(B, 
$BE:;zIU$-$NITDj85$r@8@.$9$k>l9g$KB?$/MQ$$$i$l$k(B. 
@item
$B5U$K(B, $BJ8;zNs$rITDj85$KJQ49$9$k;~$K$O(B, @code{strtov} $B$rMQ$$$k(B. 
\E
\BEG
@item
Convert an arbitrary object @var{obj} into a string.
@item
This function is convenient to create variables with numbered
(or indexed) names by converting integers into strings and appending them
to some name strings.
@item
Use @code{strtov()} for inverse conversion from string to indeterminate.
\E
@end itemize

@example
[0] A=afo;
afo
[1] type(A);
2
[2] B=rtostr(A); 
afo
[3] type(B);
7
[4] B+"1";
afo1
@end example

@table @t
\JP @item $B;2>H(B
\EG @item References
@fref{strtov}, @fref{type}.
@end table

\JP @node strtov,,, $BJ8;zNs$K4X$9$k1i;;(B
\EG @node strtov,,, Strings
@subsection @code{strtov}
@findex strtov

@table @t
@item strtov(@var{str})
\JP :: @var{str} ($BJ8;zNs(B) $B$rITDj85$KJQ$($k(B. 
\EG :: Convert a string @var{str} into an indeterminate.
@end table

@table @var
@item return
\JP $BITDj85(B
\EG intederminate
@item str
\JP $BITDj85$H$7$FJQ492DG=$JJ8;zNs(B
\EG string which is valid to constitute an indeterminate.
@end table

@itemize @bullet
\BJP
@item
$BITDj85$H$7$FJQ492DG=$JJ8;zNs$rITDj85$KJQ$($k(B. 
@item
$BITDj85$H$7$FJQ492DG=$JJ8;zNs$H$O(B, $B1Q>.J8;z$G;O$^$j(B, 
$B1Q;z(B, $B?t;z$*$h$S5-9f(B @code{_} $B$G:n$i$l$kJ8;zNs$G$"$k(B. 
@item
@code{rtostr()} $B$HAH9g$;$F(B, $B%W%m%0%i%`Cf$G<+F0E*$KITDj85$r@8@.$7$?$$;~$K(B
$BMQ$$$i$l$k(B. 
\E
\BEG
@item
Convert a string that is valid for an indeterminate into an indeterminate
which have @var{str} as its print name.
@item
The valid string for an indeterminate is such a string that begins
with a small alphabetical letter possibly followed by any string composed
of alphabetical letters, digits or a symbol @samp{_}.
@item
Use the command to create indeterminates dynamically in programs.
\E
@end itemize

@example
[0] A="afo";
afo
[1] for (I=0;I<3;I++) @{B=strtov(A+rtostr(I)); print([B,type(B)]);@}
[afo0,2]
[afo1,2]
[afo2,2]
@end example

@table @t
\JP @item $B;2>H(B
\EG @item References
@fref{rtostr}, @fref{type}, @fref{uc}.
@end table

\JP @node eval_str,,, $BJ8;zNs$K4X$9$k1i;;(B
\EG @node eval_str,,, Strings
@subsection @code{eval_str}
@findex eval_str

@table @t
@item eval_str(@var{str})
\JP :: @var{str} ($BJ8;zNs(B) $B$rI>2A$9$k(B. 
\EG :: Evaluates a string @var{str}.
@end table

@table @var
@item return
\JP $B%*%V%8%'%/%H(B
\EG object
@item str
\JP @b{Asir} $B$N(B parser $B$,<uM}2DG=$JJ8;zNs(B
\EG string which can be accepted by @b{Asir} parser
@end table

@itemize @bullet
\BJP
@item
@b{Asir} $B$N(B parser $B$,<uM}2DG=$JJ8;zNs$rI>2A$7$F$=$N7k2L$rJV$9(B. 
@item
$BI>2A2DG=$JJ8;zNs$O(B, $B<0$rI=$9$b$N$K8B$k(B. 
@item
$BO@M}E*$K$O(B @code{rtostr()} $B$N5U4X?t$H$J$k(B. 
\E
\BEG
@item
This function evaluates a string which can be accepted by @b{Asir} parser
and returns the result.
@item
The input string should represent an expression.
@item
This functions is the inversion function of @code{rtostr()}.
\E
@end itemize

@example
[0] eval_str("1+2");
3
[1] fctr(eval_str(rtostr((x+y)^10)));
[[1,1],[x+y,10]]
@end example

@table @t
\JP @item $B;2>H(B
\EG @item References
@fref{rtostr}
@end table