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

Annotation of OpenXM/src/asir-doc/parts/builtin/misc.texi, Revision 1.14

1.14    ! ohara       1: @comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/misc.texi,v 1.13 2003/08/22 00:44:57 noro Exp $
1.3       noro        2: \BJP
1.1       noro        3: @node $B$=$NB>(B,,, $BAH$_9~$_H!?t(B
                      4: @section $B$=$NB>(B
1.3       noro        5: \E
                      6: \BEG
                      7: @node Miscellaneouses,,, Built-in Function
                      8: @section Miscellaneouses
                      9: \E
1.1       noro       10:
                     11: @menu
                     12: * ctrl::
                     13: * debug::
                     14: * error::
                     15: * help::
                     16: * time::
                     17: * cputime tstart tstop::
1.8       noro       18: * timer::
1.1       noro       19: * heap::
                     20: * version::
                     21: * shell::
                     22: * map::
                     23: * flist::
                     24: * delete_history::
                     25: * get_rootdir::
1.2       noro       26: * getopt::
1.3       noro       27: * getenv::
1.1       noro       28: @end menu
                     29:
1.3       noro       30: \JP @node ctrl,,, $B$=$NB>(B
                     31: \EG @node ctrl,,, Miscellaneouses
1.1       noro       32: @subsection @code{ctrl}
                     33: @findex ctrl
                     34:
                     35: @table @t
                     36: @item ctrl("@var{switch}"[,@var{obj}])
1.3       noro       37: \JP :: $B4D6-@_Dj(B
                     38: \EG :: Sets the value of @var{switch}.
1.1       noro       39: @end table
                     40:
                     41: @table @var
                     42: @item return
1.3       noro       43: \JP $B@_Dj$5$l$F$$$kCM(B
                     44: \EG value of @var{switch}
1.1       noro       45: @item switch
1.3       noro       46: \JP $B%9%$%C%AL>(B
                     47: \EG switch name
1.1       noro       48: @item obj
1.3       noro       49: \JP $B%Q%i%a%?(B
                     50: \EG parameter
1.1       noro       51: @end table
                     52:
                     53: @itemize @bullet
1.3       noro       54: \BJP
1.1       noro       55: @item
                     56: @b{Asir} $B$N<B9T4D6-$N@_DjJQ99(B, $B;2>H$r9T$&(B.
                     57: @item @var{switch} $B$N$_$N>l9g(B, $B$=$N%9%$%C%A$N8=:_$N>uBV$rJV$9(B.
                     58: @item @var{obj} $B$,M?$($i$l$F$$$k$H$-(B, $B$=$NCM$r@_Dj$9$k(B.
                     59: @item
                     60: $B%9%$%C%A$OJ8;zNs$H$7$FF~NO$9$k(B. $B$9$J$o$A%@%V%k%/%)!<%H$G0O$`(B.
                     61: @item
1.3       noro       62: $B%9%$%C%A$O<!$NDL$j(B. $B0J2<$G(B, on $B$O(B 1, off $B$O(B 0 $B$r0UL#$9$k(B.
1.1       noro       63: @table @code
                     64: @item cputime
                     65: on $B$N;~(B CPU time $B$*$h$S(B GC time $B$rI=<((B, off $B$N;~(B $BI=<($7$J$$(B. @code{cputime()}
                     66: $B$r;2>H(B.
                     67: @code{ctrl("cputime",@var{onoff})} $B$O(B @code{cputime(@var{onoff})} $B$HF1$8$G$"$k(B.
                     68: @item nez
                     69: EZGCD $B$N%"%k%4%j%:%`$N@ZBX$((B. $B%G%U%)%k%H$G(B 1 $B$G$"$j(B, $B$H$/$K@ZBX$($kI,MW(B
                     70: $B$O$J$$(B.
                     71: @item echo
                     72: on $B$N;~$OI8=`F~NO$r7+$jJV$7$F=PNO$7(B, off $B$N;~$OI8=`F~NO$r7+$jJV$5$J$$(B.
                     73: @code{output} $B%3%^%s%I$rMQ$$$k:]$KM-8z$G$"$k(B.
                     74: @item bigfloat
                     75: on $B$N;~(B, $BF~NO$5$l$?IbF0>.?t$O(B @b{bigfloat} $B$KJQ49$5$l(B, $BIbF0>.?t1i;;$O(B
1.10      noro       76: @b{PARI} (@ref{pari}) $B$K$h$j9T$o$l$k(B. $B%G%U%)%k%H$NM-8z7e?t$O(B 9 $B7e$G$"$k(B.
1.1       noro       77: $BM-8z7e?t$rA}$d$7$?$$;~$K$O(B @code{setprec()} $B$rMQ$$$k(B.
                     78: off $B$N;~(B, $BF~NO$5$l$?IbF0>.?t$O(B, $BG\@:EYIbF0>.?t$KJQ49$5$l$k(B.
                     79: @cindex PARI
                     80: @item adj
                     81: $B%,!<%Y%C%8%3%l%/%7%g%s$NIQEY$NJQ99(B. 1 $B0J>e$NM-M}?t$,;XDj$G$-$k(B.
                     82: $B%G%U%)%k%HCM$O(B 3. 1 $B$K6a$$Dx(B, $B%,!<%Y%C%8%3%l%/%7%g%s$;$:$K%R!<%W$r(B
                     83: $BBg$-$/$H$k$h$&$K$J$k(B. $B@0?tCM$O%3%^%s%I%i%$%s$G;XDj$G$-$k(B.
                     84: @xref{$B%3%^%s%I%i%$%s%*%W%7%g%s(B}.
                     85: @item verbose
                     86: on $B$N;~(B, $BH!?t$N:FDj5A;~$K%a%C%;!<%8$rI=<($9$k(B.
1.14    ! ohara      87: @item quiet_mode
        !            88: 1 $B$N$H$-(B, $B5/F0;~$KCx:n8"I=<($r9T$o$J$$(B.
1.1       noro       89: @item hex
                     90: 1 $B$N$H$-(B, $B@0?t$O(B 0x $B$G;O$^$k(B 16 $B?J?t$H$7$FI=<($5$l$k(B. -1 $B$N$H$-(B, 16 $B?J?t$O(B,
                     91: $B4V$K(B @samp{|} $B$r$O$5$s$G(B 8 $B7e$4$H$K6h@Z$C$FI=<($5$l$k(B.
1.13      noro       92: @item real_digit
                     93: $BG\@:EYIbF0>.?t$NI=<($N7e?t$r;XDj$9$k(B.
                     94: @item double_output
                     95: 1 $B$N$H$-(B, $BG\@:EYIbF0>.?t$O$D$M$K(B ddd.ddd $B$N7A$GI=<($5$l$k(B.
1.6       noro       96: @item fortran_output
                     97: 1 $B$N$H$-(B, $BB?9`<0$NI=<($,(B FORTRAN $B%9%?%$%k$K$J$k(B. $B$9$J$o$AQQ$,(B
                     98: @samp{^} $B$NBe$o$j$K(B @samp{**} $B$GI=$5$l$k(B.
                     99: ($B%G%U%)%k%HCM$O(B 0.)
1.1       noro      100: @item ox_batch
                    101: 1 $B$N$H$-(B, $BAw?.%P%C%U%!$,$$$C$Q$$$K$J$C$?;~$N$_<+F0E*$K(B flush.
                    102: 0 $B$N$H$-(B, $B%G!<%?(B, $B%3%^%s%IAw?.Kh$K(B flush. ($B%G%U%)%k%HCM$O(B 0.)
1.10      noro      103: @xref{$BJ,;67W;;(B}.
1.1       noro      104: @item ox_check
                    105: 1 $B$N$H$-(B, $BAw?.%G!<%?$rAj<j%W%m%;%9$,<u$1<h$l$k$+$I$&$+%A%'%C%/$9$k(B.
                    106: 0 $B$N$H$-$7$J$$(B. ($B%G%U%)%k%HCM$O(B 1.)
1.10      noro      107: @xref{$BJ,;67W;;(B}.
1.5       noro      108: @item ox_exchange_mathcap
                    109: 1 $B$N$H$-(B, OX server $B$H$N@\B33+;O;~$K(B, $B<+F0E*$K(B mathcap $B$N8r49$r9T$&(B.
                    110: ($B%G%U%)%k%HCM$O(B 1.)
1.10      noro      111: @xref{$BJ,;67W;;(B}.
1.1       noro      112: @end table
1.3       noro      113: \E
                    114: \BEG
                    115: @item
                    116: This function is used to set or to get the values of switches.
                    117: The switches are used to control an execution of @b{Asir}.
                    118: @item If @var{obj} is not specified, the value of @var{switch} is returned.
                    119: @item If @var{obj} is specified, the value of @var{switch} is set to
                    120: @var{obj}.
                    121: @item
                    122: Switches are specified by strings, namely, enclosed by two
                    123: double quotes.
                    124: @item
                    125: Here are of switches of @b{Asir}.
                    126: @table @code
                    127: @item cputime
                    128: If `on', CPU time and GC time is displayed at every top level evaluation
                    129: of @b{Asir} command; if `off', not displayed.
                    130: @xref{cputime tstart tstop}.
                    131: (The switch is also set by command @code{cputime(1)}, and
                    132: reset by @code{cputime(0)}.)
                    133: @item nez
                    134: Selection for EZGCD algorithm.  It is set to 1 by default.  Ordinary
                    135: users need not change this setting.
                    136: @item echo
                    137: If `on', inputs from the standard input will be echoed onto the
                    138: standard output.  When executing to load a file, the contents of the
                    139: file will be written onto the standard output.
                    140: If `off', the inputs will not be echoed.
                    141: This command will be useful when used with command @code{output}.
                    142: @item bigfloat
                    143: If `on', floating operations will be done by @b{PARI} system with arbitrary
                    144: precision floating point operations.
                    145: Default precision is set to 9 digits.  To change the precision, use
                    146: command @code{setprec}.
                    147: If `off', floating operations will be done by @b{Asir}'s own floating
                    148: operation routines with a fixed precision operations of
                    149: standard floating double.
                    150: @cindex PARI
                    151: @item adj
                    152: Sets the frequency of garbage collection. A rational number greater
                    153: than or equal to 1 can be specified. The default value is 3.
                    154: If a value closer to 1 is specified, larger heap is allocated
                    155: and as a result, the frequency of garbage collection decreases.
                    156: @xref{Command line options}.
                    157: @item verbose
                    158: If `on' a warning messages is displayed when a function is redefined.
1.14    ! ohara     159: @item quiet_mode
        !           160: If 1 is set, the copyright notice has been displayed at boot time.
1.3       noro      161: @item hex
                    162: If 1 is set, integers are displayed as hexadecimal numbers with prefix
1.13      noro      163: @code{0x}. if -1 is set, hexadecimal numbers are displayed with
1.3       noro      164: @samp{|} inserted at every 8 hexadecimal digits.
1.13      noro      165: @item real_digit
                    166: Sets the number of digits used to print a floating double.
                    167: @item double_output
                    168: If set to 1, any floating double is printed in the style ddd.ddd.
1.6       noro      169: @item fortran_output
                    170: If `on' polynomials are displayed in FORTRAN style. That is, a power
                    171: is represented by @samp{**} instead of @samp{^}.
                    172: The default value is 'off.
1.3       noro      173: @item ox_batch
                    174: If 'on', the OpenXM send buffer is flushed only when the buffer is full.
                    175: If 'off', the buffer is always flushed at each sending of data or command.
                    176: The default value is 'off'.
1.10      noro      177: @xref{Distributed computation}.
1.3       noro      178: @item ox_check
                    179: If 'on' the check by mathcap is done before sending data.
1.5       noro      180: The default value is 'on'.
1.10      noro      181: @xref{Distributed computation}.
1.5       noro      182: @item ox_exchange_mathcap
                    183: If 'on' Asir forces the exchange of mathcaps at the communication startup.
1.3       noro      184: The default value is 'on'.
1.10      noro      185: @xref{Distributed computation}.
1.3       noro      186: @end table
                    187: \E
1.1       noro      188: @end itemize
                    189:
                    190: @table @t
1.3       noro      191: \JP @item $B;2>H(B
                    192: \EG @item References
1.1       noro      193: @fref{cputime tstart tstop}, @fref{output},
1.7       noro      194: @fref{pari}, @fref{setprec}, @fref{eval deval}.
1.1       noro      195: @end table
                    196:
1.3       noro      197: \JP @node debug,,, $B$=$NB>(B
                    198: \EG @node debug,,, Miscellaneouses
1.1       noro      199: @subsection @code{debug}
                    200: @findex debug
                    201:
                    202: @table @t
                    203: @item debug
1.3       noro      204: \JP :: $B%G%P%C%0%b!<%I$KF~$k(B.
                    205: \EG :: Forces to enter into debugging mode.
1.1       noro      206: @end table
                    207:
                    208: @itemize @bullet
1.3       noro      209: \BJP
1.1       noro      210: @item
                    211: @code{debug} $B$OL50z?t$NH!?t$G$"$k$,(B, @samp{()} $B$J$7$G8F$S=P$;$k(B.
                    212: @item
                    213: $B%G%P%C%0%b!<%I$KF~$k$H%W%m%s%W%H$,(B @code{(debug)} $B$H$J$j(B, $B%3%^%s%I(B
                    214: $B<u$1IU$1>uBV$H$J$k(B. @code{quit} $B$rF~NO$9$k$H%G%P%C%,$+$iH4$1$k(B.
                    215: @item
                    216: $B%G%P%C%0%b!<%I$K$D$$$F$N>\:Y$O(B @xref{$B%G%P%C%,(B}.
1.3       noro      217: \E
                    218: \BEG
                    219: Function @code{debug} is a function with no argument.
                    220: It can be called without @samp{()}.
                    221: @item
                    222: In the debug-mode, you are prompted by @code{(debug)} and
                    223: the debugger is ready for commands.
                    224: Typing in @code{quit} (Note! without a semicolon.) brings you
                    225: to exit the debug-mode.
                    226: @item
1.10      noro      227: See @ref{Debugger} for details.
1.3       noro      228: \E
1.1       noro      229: @end itemize
                    230:
                    231: @example
                    232: [1] debug;
                    233: (debug) quit
                    234: 0
                    235: [2]
                    236: @end example
                    237:
1.3       noro      238: \JP @node error,,, $B$=$NB>(B
                    239: \EG @node error,,, Miscellaneouses
1.1       noro      240: @subsection @code{error}
                    241: @findex error
                    242:
                    243: @table @t
                    244: @item error(@var{message})
1.3       noro      245: \JP :: $B%W%m%0%i%`Cf$G6/@)E*$K%(%i!<$rH/@8$5$;$k(B.
                    246: \EG :: Forces @b{Asir} to cause an error and enter debugging mode.
1.1       noro      247: @end table
                    248:
                    249: @table @var
                    250: @item message
1.3       noro      251: \JP $BJ8;zNs(B
                    252: \EG string
1.1       noro      253: @end table
                    254:
                    255: @itemize @bullet
1.3       noro      256: \BJP
1.1       noro      257: @item
                    258: $B0lHL$K(B, $B0z?t$N4V0c$$$J$I(B, $BB39TIT2DG=$J%(%i!<$,AH$_9~$_H!?t$K$*$$$F(B
                    259: $BH/@8$7$?;~(B, $B%H%C%W%l%Y%k$KLa$kA0$K(B, $B2DG=$J$i$P$=$N%(%i!<$N;~E@$G(B
                    260: $B%G%P%C%0%b!<%I$KF~$k(B. @code{error()} $B$O(B, $B%f!<%6H!?t$NFbIt$G$3$N(B
                    261: $BF0:n$HF1MM$NF0:n$r9T$o$;$k$?$a$NH!?t$G$"$k(B.
                    262: @item
                    263: $B0z?t$O(B, @code{error()} $B$,8F$S=P$5$l$k:]$KI=<($5$l$k%a%C%;!<%8$G(B,
                    264: $BJ8;zNs$G$"$k(B.
                    265: @item
                    266: $B%f!<%6H!?t$K$*$$$F(B, $BJQ?t$r%A%'%C%/$7$F(B, $B$"$jF@$J$$CM$N>l9g$K(B @code{error()}
                    267: $B$r8F$S=P$9$h$&$K$7$F$*$1$P(B, $B$=$N;~E@$G<+F0E*$K%G%P%C%0%b!<%I$KF~$l$k(B.
1.3       noro      268: \E
                    269: \BEG
                    270: @item
                    271: When @b{Asir} encounters a serious error such that it finds difficult
                    272: to continue execution,
                    273: it, in general, tries to enter debugging mode before it returns to
                    274: top level.
                    275: The command @code{error()} forces a similar behavior in a user program.
                    276: @item
                    277: The argument is a string which will be displayed when @code{error()}
                    278: will be executed.
                    279: @item
                    280: You can enter the debug-mode when your program encounters an illegal
                    281: value for a program variable, if you have written the program
                    282: so as to call @code{error()} upon finding such an error in your program
                    283: text.
                    284: \E
1.1       noro      285: @end itemize
                    286:
                    287: @example
                    288: % cat mod3
                    289: def mod3(A) @{
                    290:         if ( type(A) >= 2 )
                    291:                 error("invalid argument");
                    292:         else
                    293:                 return A % 3;
                    294: @}
                    295: end$
                    296: % asir
                    297: [0] load("mod3");
                    298: 1
                    299: [3] mod3(5);
                    300: 2
                    301: [4] mod3(x);
                    302: invalid argument
                    303: stopped in mod3 at line 3 in file "./mod3"
                    304: 3                       error("invalid argument");
                    305: (debug) print A
                    306: A = x
                    307: (debug) quit
                    308: return to toplevel
                    309: [4]
                    310: @end example
                    311:
                    312: @table @t
1.3       noro      313: \JP @item $B;2>H(B
                    314: \EG @item References
1.1       noro      315: @fref{debug}.
                    316: @end table
                    317:
1.3       noro      318: \JP @node help,,, $B$=$NB>(B
                    319: \EG @node help,,, Miscellaneouses
1.1       noro      320: @subsection @code{help}
                    321: @findex help
                    322:
                    323: @table @t
                    324: @item help(["@var{function}"])
1.3       noro      325: \JP :: $BH!?t$N@bL@$rI=<($9$k(B.
                    326: \EG :: Displays the description of function @var{function}.
1.1       noro      327: @end table
                    328:
                    329: @table @var
                    330: @item return
                    331: 0
                    332: @item function
1.3       noro      333: \JP $BH!?tL>(B
                    334: \EG function name
1.1       noro      335: @end table
                    336:
                    337: @itemize @bullet
1.3       noro      338: \BJP
1.1       noro      339: @item
                    340: $BL50z?t$N;~(B, $B:G>.8B$N@bL@$,I=<($5$l$k(B. $BH!?tL>$,0z?t$H$7$FM?$($i$l$?(B
                    341: $B$H$-(B, $BI8=`%i%$%V%i%j%G%#%l%/%H%j$K$"$k(B @samp{help} $B$H$$$&%G%#%l%/%H%j(B
                    342: $B$KF1L>$N%U%!%$%k$,$"$l$P(B, $B4D6-JQ?t(B @code{PAGER} $B$K@_Dj$5$l$F$$$k%3%^%s%I(B,
                    343: $B$"$k$$$O(B @samp{more} $B$r8F$S=P$7$F$=$N%U%!%$%k$rI=<($9$k(B.
                    344: @item
1.4       noro      345: $B4D6-JQ?t(B @code{LANG} $B$,@_Dj$5$l$F$$$k>l9g(B, $B$=$NCM$,(B @code{"japan"} $B$^$?$O(B
                    346: @code{"ja_JP"} $B$G;O$^$k$J$i(B, @samp{help} $B$NBe$o$j$K(B @samp{help-jp}
                    347: $B$K$"$k%U%!%$%k$,I=<($5$l$k(B. $B$=$&$G$J$$>l9g(B, @samp{help-eg}
                    348: $B$K$"$k%U%!%$%k$,I=<($5$l$k(B.
                    349: @item
1.1       noro      350: Windows $BHG$G$O(B, $B%3%^%s%I%i%$%s$+$i$N%X%k%W8F$S=P$7$OL$%5%]!<%H$@$,(B,
                    351: $B%a%K%e!<$+$i(B HTML $B7A<0$N$b$N$r8F$S=P$7MQ$$$k$3$H$,$G$-$k(B.
1.3       noro      352: \E
                    353: \BEG
                    354: @item
                    355: If invoked without argument, it displays rough usage of @b{Asir}.
                    356: @item
                    357: If a function name is given and if there exists a file with the
                    358: same name in the directory @samp{help} under standard library directory,
                    359: the file is displayed by a command set to the environmental variable
                    360: @code{PAGER} or else command @samp{more}.
1.4       noro      361: @item
                    362: If the @code{LANG} environment variable is set and its value
                    363: begins with @code{"japan"} or @code{"ja_JP"}, then the file in
                    364: @samp{help-jp} is displayed. If its value does not begin with
                    365: @code{"japan"} or @code{"ja_JP"}, then the file in @samp{help-eg}
                    366: is displayed.
1.3       noro      367: @item
                    368: On Windows HTML-style help is available from the menu.
                    369: \E
1.1       noro      370: @end itemize
                    371:
1.3       noro      372: \JP @node time,,, $B$=$NB>(B
                    373: \EG @node time,,, Miscellaneouses
1.1       noro      374: @subsection @code{time}
                    375: @findex time
                    376:
                    377: @table @t
                    378: @item time()
1.3       noro      379: \JP :: $B%;%C%7%g%s3+;O$+$i8=:_$^$G$N(B CPU $B;~4V$*$h$S(B GC $B;~4V$rI=<($9$k(B
                    380: \BEG
                    381: :: Returns a four element list consisting of
                    382: total CPU time, GC time, the elapsed time
                    383: and also total memory quantities requested
                    384: from the start of current @b{Asir} session.
                    385: \E
1.1       noro      386: @end table
                    387:
                    388: @table @var
                    389: @item return
1.3       noro      390: \JP $B%j%9%H(B
                    391: \EG list
1.1       noro      392: @end table
                    393:
                    394: @itemize @bullet
1.3       noro      395: \BJP
1.1       noro      396: @item
                    397: CPU $B;~4V$*$h$S(B GC $B;~4V$NI=<($K4X$9$k%3%^%s%I$G$"$k(B.
                    398: @item
                    399: GC $B;~4V$H$O(B, $B%,!<%Y%8%3%l%/%?$K$h$j>CHq$5$l$?$H8+$J$5$l$k;~4V(B,
                    400: CPU $B;~4V$O(B, $BA4BN$N(B CPU $B;~4V$+$i(B GC $B;~4V$r0z$$$?;D$j$G(B, $BC10L$OIC$G$"$k(B.
                    401: @item
                    402: @code{time()} $B$O0z?t$J$7$G(B, $B%;%C%7%g%s3+;O$+$i8=:_$^$G$N(B CPU $B;~4V(B,
                    403: GC $B;~4V(B, $B8=:_$^$G$KMW5a$5$l$?%a%b%j$N$N$YMFNL(B, $B$*$h$S%;%C%7%g%s3+;O$+$i(B
                    404: $B8=:_$^$G$N7P2a;~4V$NI=<($r$9$k(B.
                    405: $B$9$J$o$A(B, @code{[CPU $B;~4V(B ($BIC(B), GC $B;~4V(B ($BIC(B), $B%a%b%jNL(B ($B%o!<%I(B), $B7P2a;~4V(B ($BIC(B)]}
                    406: $B$J$k%j%9%H$rJV$9(B. 1 $B%o!<%I$ODL>o(B 4 $B%P%$%H$G$"$k(B.
                    407: @item
                    408: $B7W;;$N<B9T3+;O;~(B, $B=*N;;~$N(B @code{time()} $B$+$i(B, $B$=$N7W;;$KBP$9$k(B
                    409: CPU $B;~4V(B, GC $B;~4V$,$o$+$k(B.
                    410: @item
                    411: $B%a%b%jNL$OB?G\D9?t$G$O$J$$$?$a(B, $B$"$kCM$r1[$($k$HL50UL#$JCM$H$J$k$?$a(B
                    412: $B$"$/$^$G$bL\0B$H$7$FMQ$$$k$Y$-$G$"$k(B.
                    413: @item
                    414: @code{ctrl()} $B$d(B @code{cputime()} $B$K$h$j(B @code{cputime} $B%9%$%C%A$,(B
                    415: on $B$K$J$C$F$$$k>l9g$K$O(B, $B%H%C%W%l%Y%k$NJ8$r0l$D$NC10L$H$7$F(B,
                    416: $B$=$N<B9T;~4V$,I=<($5$l$k(B. $B$7$+$7(B, $B%W%m%0%i%`$NFbIt$J$I$G(B, $BFCDj$N(B
                    417: $B7W;;$KBP$9$k7W;;;~4V$rCN$j$?$$;~$K$O(B, @code{time()} $B$J$I$r;H$&(B
                    418: $BI,MW$,$"$k(B.
                    419: @item
                    420: @code{getrusage()} $B$,;H$($k(B UNIX $B>e$G$O(B @code{time()} $B$O?.Mj@-$N$"$kCM(B
                    421: $B$rJV$9$,(B, Windows 95, 98 $B>e$G$O;~9o$rMQ$$$k$[$+J}K!$,$J$$$?$a7P2a;~4V$=$N$b$N(B
                    422: $B$,I=<($5$l$k(B. $B$h$C$F(B, $BBT$A>uBV$,$"$k$H(B, $B$=$l$b7P2a;~4V$K2C;;$5$l$k(B.
1.3       noro      423: \E
                    424: \BEG
                    425: @item
                    426: These are commands regarding CPU time and GC time.
                    427: @item
                    428: The GC time is the time regarded to spent by the garbage collector,
                    429: and the CPU time is the time defined by subtracting the GC time from
                    430: the total time consumed by command @b{Asir}.  Their unit is `second.'
                    431: @item
                    432: Command @code{time()} returns total CPU time and GC time measured
                    433: from the start of current @b{Asir} session. It also returns the elapsed
                    434: time. Time unit is `second.'
                    435: Moreover, it returns total memory quantities in words
                    436: (usually 4 bytes) which are requested
                    437: to the memory manager from the beginning of the current session.
                    438: The return value is a list and the format is @code{[CPU time, GC time,
                    439: Memory, Elapsed time]}.
                    440: @item
                    441: You can find the CPU time and GC time for some computation by taking
                    442: the difference of the figure reported by @code{time()} at the beginning
                    443: and the ending of the computation.
                    444: @item
                    445: Since arbitrary precision integers are NOT used for counting
                    446: the total amount of memory request, the number will eventually happen
                    447: to become meaningless due to integer overflow.
                    448: @item
                    449: When @code{cputime} switch is active by @code{ctrl()} or by
                    450: @code{cputime()}, the execution time will be displayed after every
                    451: evaluation of top level statement.
                    452: In a program, however, in order to know the execution time for a
                    453: sequence of computations, you have to use @code{time()} command, for
                    454: an example.
                    455: @item
                    456: On UNIX, if @code{getrusage()} is available, @code{time()} reports
                    457: reliable figures. On Windows NT it also gives reliable CPU time.
                    458: However, on Windows 95/98, the reported time is nothing but
                    459: the elapsed time of the real world.
                    460: Therefore, the time elapsed in the debug-mode and the time of waiting
                    461: for a reply to interruption prompting are added to the elapsed time.
                    462: \E
1.1       noro      463: @end itemize
                    464:
                    465: @example
                    466: [72] T0=time();
                    467: [2.390885,0.484358,46560,9.157768]
                    468: [73] G=hgr(katsura(4),[u4,u3,u2,u1,u0],2)$
                    469: [74] T1=time();
                    470: [8.968048,7.705907,1514833,63.359717]
                    471: [75] ["CPU",T1[0]-T0[0],"GC",T1[1]-T0[1]];
                    472: [CPU,6.577163,GC,7.221549]
                    473: @end example
                    474:
                    475: @table @t
1.3       noro      476: \JP @item $B;2>H(B
                    477: \EG @item References
1.1       noro      478: @fref{cputime tstart tstop}.
                    479: @end table
                    480:
1.3       noro      481: \JP @node cputime tstart tstop,,, $B$=$NB>(B
                    482: \EG @node cputime tstart tstop,,, Miscellaneouses
1.1       noro      483: @subsection @code{cputime}, @code{tstart}, @code{tstop}
                    484: @findex cputime
                    485: @findex tstart
                    486: @findex tstop
                    487:
                    488: @table @t
                    489: @item cputime(@var{onoff})
1.3       noro      490: \JP :: $B0z?t$,(B 0 $B$J$i$P(B @code{cputime} $B$NI=<($r;_$a$k(B. $B$=$l0J30$J$i$PI=<($r9T$&(B.
                    491: \BEG
                    492: :: Stop displaying @code{cputime} if its argument is 0, otherwise
                    493: start displaying @code{cputime} after every top level evaluation of
                    494: Asir command.
                    495: \E
1.1       noro      496: @item tstart()
1.3       noro      497: \JP :: CPU time $B7WB,3+;O(B.
                    498: \EG :: Resets and starts timer for CPU time and GC time.
1.1       noro      499: @item tstop()
1.3       noro      500: \JP :: CPU time $B7WB,=*N;$*$h$SI=<((B.
                    501: \BEG
                    502: :: Stops timer and then displays CPU time GC time elapsed from the
                    503: last time when timer was started.
                    504: \E
1.1       noro      505: @end table
                    506:
                    507: @table @var
                    508: @item return
                    509: 0
                    510: @item onoff
1.3       noro      511: \JP $B%U%i%0(B ($BG$0U(B)
                    512: \EG flag (arbitrary)
1.1       noro      513: @end table
                    514:
                    515: @itemize @bullet
1.3       noro      516: \BJP
1.1       noro      517: @item
                    518: @code{cputime()} $B$O(B, $B0z?t$,(B 0 $B$J$i$P(B CPU time $B$NI=<($r;_$a$k(B. $B$=$l0J30$J$i$PI=<($r9T$&(B.
                    519: @item
                    520: @code{tsart} $B$O0z?t$J$7(B, @samp{()} $B$J$7$G(B, CPU time $B7WB,$r3+;O$9$k(B.
                    521: @item
                    522: @code{tstop} $B$O0z?t$J$7(B, @samp{()} $B$J$7$G(B, CPU time $B7WB,$r=*N;(B,
                    523: $B$*$h$SI=<($9$k(B.
                    524: @item
                    525: @code{cputime(@var{onoff})} $B$O(B @code{ctrl("cputime",@var{onoff})} $B$HF1$8$G$"$k(B.
                    526: @item
                    527: @code{tstart}, @code{tstop} $B$O(B, $BF~$l;R$K$7$F;H$o$l$k$3$H$OA[Dj$7$F$$$J$$(B
                    528: $B$?$a(B, $B$=$N$h$&$J2DG=@-$,$"$k>l9g$K$O(B, @code{time()} $B$K$h$k7WB,$r9T$&(B
                    529: $BI,MW$,$"$k(B.
                    530: @item
                    531: @code{cputime()} $B$K$h$k(B on, off $B$O(B, $BC1$KI=<($N(B on, off $B$G$"$j(B, $B%H%C%W%l%Y%k(B
                    532: $B$N0l$D$NJ8$KBP$9$k7WB,$O>o$K9T$o$l$F$$$k(B. $B$h$C$F(B, $B7W;;$r;O$a$F$+$i$G$b(B,
                    533: $B7W;;=*N;A0$K%G%P%C%,$KF~$C$F(B @code{cputime(1)} $B$r<B9T$5$;$l$P7W;;;~4V$O(B
                    534: $BI=<($5$l$k(B.
1.3       noro      535: \E
                    536: \BEG
                    537: @item
                    538: Command @code{cputime()} with NON-ZERO argument enables @b{Asir} to display
                    539: CPU time and GC time after every evaluation of top level @b{Asir} command.
                    540: The command with argument 0 disables displaying them.
                    541: @item
                    542: Command @code{tstart()} starts measuring CPU time and GC time without
                    543: arguments.  The parentheses @samp{()} may be omitted.
                    544: @item
                    545: Command @code{tstop()} stops measuring CPU time and GC time and displays
                    546: them without arguments. The parentheses @samp{()} may be omitted.
                    547: @item
                    548: Command @code{cputime(@var{onoff})} has same meaning as
                    549: @code{ctrl("cputime",@var{onoff})}.
                    550: @item
                    551: Nested use of @code{tstart()} and @code{tstop()} is not expected.
                    552: If such an effect is desired, use @code{time()}.
                    553: @item
                    554: On and off states by @code{cputime()} have effects only to displaying
                    555: mode.  Time for evaluation of every top level statement is always
                    556: measured.
                    557: Therefore, even after a computation has already started,
                    558: you can let @b{Asir} display the timings, whenever you enter
                    559: the debug-mode and execute @code{cputime(1)}.
                    560: \E
1.1       noro      561: @end itemize
                    562:
                    563: @example
                    564: [49] tstart$
                    565: [50] fctr(x^10-y^10);
                    566: [[1,1],[x+y,1],[x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],[x-y,1],
                    567: [x^4+y*x^3+y^2*x^2+y^3*x+y^4,1]]
                    568: [51] tstop$
                    569: 80msec + gc : 40msec
                    570: @end example
                    571:
                    572: @table @t
1.3       noro      573: \JP @item $B;2>H(B
                    574: \EG @item References
1.1       noro      575: @fref{time}, @fref{ctrl}.
                    576: @end table
1.8       noro      577:
                    578: \JP @node timer,,, $B$=$NB>(B
                    579: \EG @node timer,,, Miscellaneouses
                    580: @subsection @code{timer}
                    581: @findex timer
                    582:
                    583: @table @t
                    584: @item timer(@var{interval},@var{expr},@var{val})
                    585: \JP :: $B@)8B;~4V$D$-$G7W;;$r<B9T$9$k(B.
                    586: \BEG
                    587: :: Compute an expression under the interval timer.
                    588: \E
                    589: @end table
                    590:
                    591: @table @var
                    592: @item return
                    593: \JP $B7k2L(B
                    594: \EG result
                    595:
                    596: @item interval
                    597: \JP $B@)8B;~4V(B ($BIC(B)
                    598: \EG interval (second)
                    599:
                    600: @item expr
                    601: \JP $B7W;;$9$k<0(B
                    602: \EG expression to be computed
                    603:
                    604: @item val
                    605: \JP $B%?%$%^$K$h$kCfCG;~$NLa$jCM(B
                    606: \EG a value to be returned when the timer is expired
                    607: @end table
                    608:
                    609: @itemize @bullet
                    610:
                    611: \BJP
                    612: @item
                    613: @code{timer()} $B$O(B, $B;~4V$r;XDj$7$F7W;;$r<B9T$9$k(B. $B;XDj;~4VFb$K7W;;$,40N;(B
                    614: $B$7$?>l9g$=$NCM$rJV$9(B. $B;XDj;~4VFb$K7W;;$,40N;$7$J$+$C$?>l9g(B, $BBh(B 3 $B0z?t(B
                    615: $B$rJV$9(B.
                    616:
                    617: @item
                    618: $BBh(B 3 $B0z?t$NCM$O(B, $B7W;;$,40N;$7$?>l9g$NCM$H6hJL$G$-$kI,MW$,$"$k(B.
                    619: \E
                    620:
                    621: \BEG
                    622: @item
                    623: @code{timer()} computes an expression under the interval timer.
                    624: If the computation finishes within the specified interval, it
                    625: returns the result of the computation. Otherwise it returns the third
                    626: argument.
                    627:
                    628: @item
                    629: The third argument should be distinguishable from the result on success.
                    630: \E
                    631:
                    632: @end itemize
                    633:
                    634: @example
                    635: [0] load("cyclic");
                    636: 1
                    637: [10] timer(10,dp_gr_main(cyclic(7),[c0,c1,c2,c3,c4,c5,c6],1,1,0),0);
                    638: interval timer expired (VTALRM)
                    639: 0
                    640: [11]
                    641: @end example
1.1       noro      642:
1.3       noro      643: \JP @node heap,,, $B$=$NB>(B
                    644: \EG @node heap,,, Miscellaneouses
1.1       noro      645: @subsection @code{heap}
                    646: @findex heap
                    647:
                    648: @table @t
                    649: @item heap()
1.3       noro      650: \JP :: $B8=:_$N%R!<%W$NBg$-$5$rJV$9(B. ($BC10L(B:$B%P%$%H(B)
                    651: \EG :: Heap area size currently in use.
1.1       noro      652: @end table
                    653:
                    654: @table @var
                    655: @item return
1.3       noro      656: \JP $B<+A3?t(B
                    657: \EG non-negative integer
1.1       noro      658: @end table
                    659:
                    660: @itemize @bullet
1.3       noro      661: \BJP
1.1       noro      662: @item
                    663: $B8=:_$N%R!<%W$NBg$-$5(B($BC10L(B : $B%P%$%H(B) $B$rJV$9(B. $B%R!<%W$H$O(B, @b{Asir} $B$N(B
                    664: $B$5$^$6$^$J?t<0$d(B, $B%f!<%6%W%m%0%i%`$J$I$,$*$+$l$k%a%b%j$NNN0h$G(B, $B%,!<%Y%8(B
                    665: $B%3%l%/%?$K$h$j4IM}$5$l$F$$$k(B. $B%W%m%0%i%`$NF0:nCf$O(B, $B%R!<%W$NBg$-$5$O(B
                    666: $BC1D4Hs8:>/$G$"$j(B, $B<B%a%b%j$NNL$r$3$($FBg$-$/$J$C$?>l9g$K$O(B, OS $B$K$h$k(B
                    667: $B%9%o%C%W%(%j%"$X$NFI$_=q$-$,$[$H$s$I$N7W;;;~4V$r@j$a$k$3$H$K$J$k(B.
                    668: @item
                    669: $B<B%a%b%j$,>/$J$$>l9g$K$O(B, $B5/F0;~$N(B @code{-adj} $B%*%W%7%g%s$K$h$j(B,
                    670: GC $B<gBN$N@_Dj$r9T$C$F$*$/I,MW$,$"$k(B.
1.3       noro      671: \E
                    672: \BEG
                    673: @item
                    674: Command @code{heap()} returns an integer which is the byte size
                    675: of current @b{Asir} heap area.
                    676:
                    677: Heap is a memory area where various data for expressions and
                    678: user programs of @b{Asir} and is managed by the garbage collector.
                    679: While @b{Asir} is running, size of the heap is monotonously
                    680: non-decreasing against the time elapsed.  If it happens to exceed the
                    681: real memory size, most (real world) time is consumed for swapping between
                    682: real memory and disk memory.
                    683: @item
                    684: For a platform with little real memory, it is recommended to set up
                    685: @b{Asir} configuration tuned for GC functions by @code{-adj} option
                    686: at the activation of @b{Asir}. (@xref{Command line options}.)
                    687: \E
1.1       noro      688: @end itemize
                    689:
                    690: @example
                    691: % asir -adj 16
                    692: [0] load("fctrdata")$
                    693: 0
                    694: [97] cputime(1)$
                    695: 0msec
                    696: [98] heap();
                    697: 524288
                    698: 0msec
                    699: [99] fctr(Wang[8])$
                    700: 3.190sec + gc : 3.420sec
                    701: [100] heap();
                    702: 1118208
                    703: 0msec
                    704: [101] quit;
                    705: % asir
                    706: [0] load("fctrdata")$
                    707: 0
                    708: [97] cputime(1)$
                    709: 0msec
                    710: [98] heap();
                    711: 827392
                    712: 0msec
                    713: [99] fctr(Wang[8])$
                    714: 3.000sec + gc : 1.180sec
                    715: [100] heap();
                    716: 1626112
                    717: 0msec
                    718: [101] quit;
                    719: @end example
                    720:
                    721: @table @t
1.3       noro      722: \JP @item $B;2>H(B
                    723: \EG @item References
                    724: \JP @fref{$B%3%^%s%I%i%$%s%*%W%7%g%s(B}.
                    725: \EG @fref{Command line options}.
1.1       noro      726: @end table
                    727:
1.3       noro      728: \JP @node version,,, $B$=$NB>(B
                    729: \EG @node version,,, Miscellaneouses
1.1       noro      730: @subsection @code{version}
                    731: @findex version
                    732:
                    733: @table @t
                    734: @item version()
1.3       noro      735: \JP :: @b{Asir} $B$N%P!<%8%g%s$rJV$9(B.
                    736: \EG :: Version identification number of  @b{Asir}.
1.1       noro      737: @end table
                    738:
                    739: @table @var
                    740: @item return
1.3       noro      741: \JP $B<+A3?t(B
                    742: \EG integer
1.1       noro      743: @end table
                    744:
                    745: @itemize @bullet
1.3       noro      746: \BJP
1.1       noro      747: @item
1.3       noro      748: @b{Asir} $B$N%P!<%8%g%s$r<+A3?t$GJV$9(B.
                    749: \E
                    750: \BEG
                    751: Command @code{version()} returns the version identification number
                    752: , an integer of @b{Asir} in use.
                    753: \E
1.1       noro      754: @end itemize
                    755:
                    756: @example
                    757: [0] version();
1.3       noro      758: 991214
1.1       noro      759: @end example
                    760:
1.3       noro      761: \JP @node shell,,, $B$=$NB>(B
                    762: \EG @node shell,,, Miscellaneouses
1.1       noro      763: @subsection @code{shell}
                    764: @findex shell
                    765:
                    766: @table @t
                    767: @item shell(@var{command})
1.3       noro      768: \JP :: @var{command} $B$r%7%'%k%3%^%s%I$H$7$F<B9T$9$k(B.
                    769: \EG :: Execute shell commands described by a string @var{command}.
1.1       noro      770: @end table
                    771:
                    772: @table @var
                    773: @item return
1.3       noro      774: \JP $B<+A3?t(B
                    775: \EG integer
1.1       noro      776: @item command
1.3       noro      777: \JP $BJ8;zNs(B
                    778: \EG string
1.1       noro      779: @end table
                    780:
                    781: @itemize @bullet
1.3       noro      782: \BJP
1.1       noro      783: @item
                    784: @var{command} $B$r(B C $B$N(B @code{system()} $BH!?t$K$h$j%7%'%k%3%^%s%I$H$7$F<B9T$9$k(B.
                    785: $B%7%'%k$N=*N;%9%F!<%?%9$rJV$9(B.
1.3       noro      786: \E
                    787: \BEG
                    788: Execute shell commands described by a string @var{command}
                    789: by a C function @code{system()}.  This returns the exit status of shell
                    790: as its return value.
                    791: \E
1.1       noro      792: @end itemize
                    793:
                    794: @example
                    795: [0] shell("ls");
1.12      noro      796: alg           da            katsura       ralg          suit
                    797: algt          defs.h        kimura        ratint        test
                    798: alpi          edet          kimura3       robot         texput.log
                    799: asir.o        fee           mfee          sasa          wang
                    800: asir_symtab   gr            mksym         shira         wang_data
                    801: base          gr.h          mp            snf1          wt
                    802: bgk           help          msubst        solve
                    803: chou          hom           p             sp
                    804: const         ifplot        proot         strum
                    805: cyclic        is            r             sugar
1.1       noro      806: 0
                    807: [1]
                    808: @end example
                    809:
1.3       noro      810: \JP @node map,,, $B$=$NB>(B
                    811: \EG @node map,,, Miscellaneouses
1.1       noro      812: @subsection @code{map}
                    813: @findex map
                    814:
                    815: @table @t
                    816: @item map(@var{function},@var{arg0},@var{arg1},...)
1.3       noro      817: \JP :: $B%j%9%H(B, $BG[Ns$N3FMWAG$KH!?t$rE,MQ$9$k(B.
                    818: \EG :: Applies a function to each member of a list or an array.
1.1       noro      819: @end table
                    820:
                    821: @table @var
                    822: @item return
1.3       noro      823: \JP @var{arg0} $B$HF1$87?$N%*%V%8%'%/%H(B
                    824: \EG an object of the same type as @var{arg0}.
1.1       noro      825: @item function
1.3       noro      826: \JP $BH!?tL>(B
                    827: \EG the name of a function
1.1       noro      828: @item arg0
1.3       noro      829: \JP $B%j%9%H(B, $B%Y%/%H%k(B, $B9TNs(B
                    830: \EG list, vector or matrix
1.11      noro      831: @item arg1  ...
1.3       noro      832: \JP $BG$0U(B ($B;D$j$N0z?t(B)
                    833: \EG arbitrary (the rest of arguments)
1.1       noro      834: @end table
                    835:
                    836: @itemize @bullet
1.3       noro      837: \BJP
1.1       noro      838: @item
                    839: @var{arg0} $B$N3FMWAG$r:G=i$N0z?t(B, @var{arg1} $B0J2<$N;D$j$N0z?t$H$7$F(B
                    840: $BH!?t(B @var{function} $B$r8F$S=P$7(B, @var{arg0} $B$NBP1~$9$kMWAG$N0LCV$K(B
                    841: $BH!?t8F$S=P$7$N7k2L$,F~$C$?F1$87?$N%*%V%8%'%/%H$r@8@.$7$FJV$9(B.
                    842: @item
                    843: @var{function} $B$O(B, $B%@%V%k%/%)!<%H$N$J$$H!?tL>$rMQ$$$k(B.
                    844: @item
                    845: @var{function} $B$K%W%m%0%i%`JQ?t$O;H$($J$$(B.
                    846: @item
                    847: @var{arg0} $B$,%j%9%H(B, $B%Y%/%H%k(B, $B9TNs0J30$N>l9g(B, $BC1$K(B @var{arg0},
                    848: @var{arg1}, ... $B$r0z?t$H$7$F(B @var{function} $B$r8F$S=P$7$=$N(B
                    849: $B7k2L$rJV$9(B.
1.3       noro      850: \E
                    851: \BEG
                    852: @item
                    853: Returns an object of the same type as @var{arg0}. Each member of the
                    854: returned object is the return value of a function call where the first
                    855: argument is the member of @var{arg0} corresponding to the member in
                    856: the returned object and the rest of the argument are @var{arg1},
                    857: @dots{}.
                    858: @item
                    859: @var{function} is a function name itself without @samp{"}.
                    860: @item
                    861: A program variable cannot be used as @var{function}.
                    862: @item
                    863: If @var{arg0} is neither list nor array this function simply
                    864: returns the value of @var{function}(@var{arg0},@var{arg1},@dots{}).
                    865: \E
1.1       noro      866: @end itemize
                    867:
                    868: @example
                    869: [82] def afo(X) @{ return X^3; @}
                    870: [83] map(afo,[1,2,3]);
                    871: [1,8,27]
                    872: @end example
                    873:
1.3       noro      874: \JP @node flist,,, $B$=$NB>(B
                    875: \EG @node flist,,, Miscellaneouses
1.1       noro      876: @subsection @code{flist}
                    877: @findex flist
                    878:
                    879: @table @t
                    880: @item flist()
1.3       noro      881: \JP :: $B8=:_Dj5A$5$l$F$$$kH!?tL>$rJ8;zNs%j%9%H$H$7$FJV$9(B.
                    882: \EG :: Returns the list of function names currently defined.
1.1       noro      883: @end table
                    884:
                    885: @table @var
                    886: @item return
1.3       noro      887: \JP $BJ8;zNs$N%j%9%H(B
                    888: \EG list of character strings
1.1       noro      889: @end table
                    890:
                    891: @itemize @bullet
1.3       noro      892: \BJP
1.1       noro      893: @item
                    894: $B8=:_Dj5A$5$l$F$$$kAH$_9~$_H!?t(B, $B%f!<%6Dj5AH!?t$NH!?tL>$rJ8;zNs%j%9%H(B
                    895: $B$H$7$FJV$9(B.
                    896: @item
                    897: $B%7%9%F%`H!?t$N8e$K%f!<%6Dj5AH!?t$,B3$/(B.
1.3       noro      898: \E
                    899: \BEG
                    900: @item
                    901: Returns the list of names of built-in functions and user defined functions
                    902: currently defined. The return value is a list of character strings.
                    903: @item
                    904: The names of built-in functions are followed by those of user defined
                    905: functions.
                    906: \E
1.1       noro      907: @end itemize
                    908:
                    909: @example
                    910: [77] flist();
                    911: [defpoly,newalg,mainalg,algtorat,rattoalg,getalg,alg,algv,...]
                    912: @end example
                    913:
1.3       noro      914: \JP @node delete_history,,, $B$=$NB>(B
                    915: \EG @node delete_history,,, Miscellaneouses
1.1       noro      916: @subsection @code{delete_history}
                    917: @findex delete_history
                    918:
                    919: @table @t
                    920: @item delete_history([@var{index}])
1.3       noro      921: \JP :: $B%R%9%H%j$r>C5n$9$k(B.
                    922: \EG :: Deletes the history.
1.1       noro      923: @end table
                    924:
                    925: @table @var
                    926: @item return
                    927: 0
                    928: @item index
1.3       noro      929: \JP $B>C5n$7$?$$%R%9%H%j$NHV9f(B
                    930: \EG Index of history to be deleted.
1.1       noro      931: @end table
                    932:
                    933: @itemize @bullet
1.3       noro      934: \BJP
1.1       noro      935: @item
                    936: $B0z?t$,$J$$$H$-(B, $B$3$l$^$G7W;;$7$?%R%9%H%j$rA4$F>C5n$9$k(B.
                    937: @item
                    938: $B0z?t$,$"$k$H$-(B, $B$=$NHV9f$N7k2L$N$_>C5n$9$k(B.
                    939: @item
                    940: $B$3$3$G%R%9%H%j$H$O(B, $BHV9f$D$-$N%W%m%s%W%H$KBP$7$F$NF~NO$rI>2A$7$FF@$i$l$?<0(B
                    941: $B$G(B, $B$3$N<0$O(B @code{@@@var{number}} $B$K$h$j<h$j=P$9$3$H$,$G$-$k(B. $B$3$N$3$H$O(B,
                    942: $B%,!<%Y%C%8%3%l%/%7%g%s$N:]$K$b$3$N<0$,@8$-;D$k$3$H$r0UL#$9$k(B.
                    943: @item
                    944: $BBg$-$J<0$,%R%9%H%j$H$7$F;D$C$?>l9g(B, $B0J9_$N%a%b%j4IM}$K;Y>c$rMh$9>l9g$,B?$$(B
                    945: $B$?$a(B, @code{bsave()} $B$J$I$G%U%!%$%k$K%;!<%V$7$F(B, @code{delete_history()}
                    946: $B$K$h$j%R%9%H%j$r>C5n$7$F$*$/$N$,M-8z$G$"$k(B.
1.3       noro      947: \E
                    948: \BEG
                    949: @item
                    950: Deletes all the histories without an argument.
                    951: @item
                    952: Deletes the history with index @var{index} if specified.
                    953: @item
                    954: A history is an expression which has been obtained by evaluating an input
                    955: given for a prompt with an index. It can be taken out by @code{@@@var{index}},
                    956: which means that the expression survives garbage collections.
                    957: @item
                    958: A large history may do harm in the subsequent memory management and
                    959: deleting the history by @code{delete_history()}, after saving it in a file
                    960: by @code{bsave()}, is often effective.
                    961: \E
1.1       noro      962: @end itemize
                    963:
                    964: @example
                    965: [0] (x+y+z)^100$
                    966: [1] @@0;
                    967: ...
                    968: [2] delete_history(0);
                    969: [3] @@0;
                    970: 0
                    971: @end example
                    972:
1.3       noro      973: \JP @node get_rootdir,,, $B$=$NB>(B
                    974: \EG @node get_rootdir,,, Miscellaneouses
1.1       noro      975: @subsection @code{get_rootdir}
                    976: @findex get_rootdir
                    977:
                    978: @table @t
                    979: @item get_rootdir()
1.3       noro      980: \JP :: Asir $B$N%k!<%H%G%#%l%/%H%jL>$r<h$j=P$9(B
                    981: \EG :: Gets the name of @b{Asir} root directory.
1.1       noro      982: @end table
                    983:
                    984: @table @var
                    985: @item return
1.3       noro      986: \JP $BJ8;zNs(B
                    987: \EG string
1.1       noro      988: @end table
                    989:
                    990: @itemize @bullet
1.3       noro      991: \BJP
1.1       noro      992: @item
                    993: UNIX $BHG$N>l9g(B, $B4D6-JQ?t(B @code{ASIR_LIBDIR} $B$,Dj5A$5$l$F$$$k>l9g$K$O$=$NCM(B, $B$5$l$F$$$J$$>l9g(B
                    994: $B$K$O(B @samp{/usr/local/lib/asir} $B$rJV$9(B.
                    995: @item
                    996: Windows $BHG$N>l9g(B, @samp{asirgui.exe} $B$N$"$k%G%#%l%/%H%j(B (@samp{bin} $B$H$$$&L>A0$N$O$:$G$"$k(B)
                    997: $B$N?F%G%#%l%/%H%j$,JV$5$l$k(B.
                    998: @item
                    999: $B$3$N4X?t$,JV$9%G%#%l%/%H%jL>$r4p=`$H$7$?AjBP%Q%9L>$r;XDj$9$k$3$H$K$h$j(B, $B%$%s%9%H!<%k(B
                   1000: $B$5$l$?>l=j$K$h$i$J$$%U%!%$%kFI$_9~$_%W%m%0%i%`$r=q$/$3$H$,$G$-$k(B.
1.3       noro     1001: \E
                   1002: \BEG
                   1003: @item
                   1004: On UNIX it returns the value of an environment variable @code{ASIR_LIBDIR}
                   1005: or @samp{/usr/local/lib/asir} if @code{ASIR_LIBDIR} is not set.
                   1006: @item
                   1007: On Windows the name of @b{Asir} root directory is returned.
                   1008: @item
                   1009: By using relative path names from the value of this function,
                   1010: one can write programs which contain file operations independent
                   1011: of the install directory.
                   1012: \E
1.1       noro     1013: @end itemize
1.2       noro     1014:
                   1015:
1.3       noro     1016: \JP @node getopt,,, $B$=$NB>(B
                   1017: \EG @node getopt,,, Miscellaneouses
1.2       noro     1018: @subsection @code{getopt}
                   1019: @findex getopt
                   1020:
                   1021: @table @t
1.9       noro     1022: @item getopt([@var{key}])
1.3       noro     1023: \JP :: $B%*%W%7%g%s$NCM$rJV$9(B.
                   1024: \EG :: Returns the value of an option.
1.2       noro     1025: @end table
                   1026:
                   1027: @table @var
                   1028: @item return
1.3       noro     1029: \JP $B%*%V%8%'%/%H(B
                   1030: \EG object
1.2       noro     1031: @end table
                   1032:
                   1033: @itemize @bullet
1.3       noro     1034: \BJP
1.2       noro     1035: @item
                   1036: $B%f!<%6Dj5A4X?t$O(B, $B8GDj8D?t0z?t$G$7$+@k8@$G$-$J$$(B. $B%f!<%6Dj5A4X?t$G(B
                   1037: $B2DJQ8D0z?t$r<B8=$9$kJ}K!$N0l$D$H$7$F(B, $B%*%W%7%g%s$K$h$k0z?t$N;XDj(B
                   1038: $B$,$"$k(B (@pxref{$B%*%W%7%g%s;XDj(B}). $B;XDj$5$l$?%*%W%7%g%s$r4X?tFb$G(B
                   1039: $B<u$1<h$k$?$a$K$3$N4X?t$rMQ$$$k(B.
                   1040: @item
1.9       noro     1041: $BL50z?t$G8F$S=P$5$l$?>l9g(B, @code{getopt()} $B$O(B
                   1042: @code{[[key1,value1],[key2,value2],...]} $B$J$k%j%9%H$rJV$9(B.
                   1043: $B$3$3$G(B, @code{key} $B$O4X?t8F$S=P$7;~$K;XDj$5$l$?%*%W%7%g%s(B, @code{value}
                   1044: $B$O$=$NCM$G$"$k(B.
                   1045: @item
1.2       noro     1046: $B4X?t8F$S=P$7$N:]$K(B @var{key} $B$,%*%W%7%g%s$H$7$F;XDj$5$l$F$$$k(B
                   1047: $B>l9g$K$O(B, $B$=$NCM$rJV$9(B. $B$b$7;XDj$,$J$$>l9g$K$O(B, VOID $B7?%*%V%8%'%/%H(B
                   1048: ($B7?<1JL;R(B -1) $B$rJV$9(B. @code{getopt()} $B$,JV$7$?CM$N7?$r(B @code{type()}
                   1049: $B$GD4$Y$k$3$H$G(B, $B$=$N%*%W%7%g%s$,;XDj$5$l$?$+$I$&$+D4$Y$k$3$H$,$G$-$k(B.
                   1050: @item
                   1051: $B4X?t8F$S=P$7$K$*$1$k%*%W%7%g%s$N;XDj$O(B, $B@55,$N0z?t$J$i$S$N8e$m$K(B,
                   1052:
                   1053: @example
                   1054: xxx(A,B,C,D|x=X,y=Y,z=Z)
                   1055: @end example
                   1056:
                   1057: $B$H$$$&Iw$K(B, @samp{|} $B$KB3$/(B, @var{key=value} $B$N(B @samp{,} $B$G6h@Z$i$l$?(B
                   1058: $BJB$S$rCV$/$3$H$G9T$&(B.
1.3       noro     1059: \E
                   1060: \BEG
                   1061: @item
                   1062: When a user defined function is called, the number of arguments
                   1063: must be equal to that in the declaration of the function.
                   1064: A function with indefinite number of arguments can be realized
                   1065: by using @var{options} (@pxref{option}).
                   1066: The value of a specified option is retrieved by @code{getopt}.
1.9       noro     1067: @item
                   1068: If @code{getopt()} is called with no argument, then it returns a list
1.12      noro     1069: @code{[[key1,value1],} @code{[key2,value2],@dots{}]}.
                   1070: In the list, each @code{key}
1.9       noro     1071: is an option which was specified when the function executing @code{getopt}
                   1072: was invoked, and @code{value} is the value of the option.
1.3       noro     1073: @item
                   1074: If an option @var{key} is specified upon a function call, @code{getopt}
                   1075: return the value of the option. If such an option is not specified,
                   1076: the it returns an object of VOID type whose object identifier is
                   1077: -1. By examining the type of the returned value with @code{type()},
                   1078: one knows whether the option is set or not.
                   1079: @item
                   1080: Options are specified as follows:
                   1081:
                   1082: @example
                   1083: xxx(A,B,C,D|x=X,y=Y,z=Z)
                   1084: @end example
                   1085:
                   1086: That is, the options are specified by a sequence of @var{key=value} seperated
                   1087: by @samp{,}, after @samp{|}.
                   1088: \E
1.2       noro     1089: @end itemize
                   1090:
                   1091: @table @t
1.3       noro     1092: \JP @item $B;2>H(B
                   1093: \EG @item References
                   1094: \JP @fref{$B%*%W%7%g%s;XDj(B}, @fref{type}.
                   1095: \EG @fref{option}, @fref{type}.
                   1096: @end table
                   1097:
                   1098: \JP @node getenv,,, $B$=$NB>(B
                   1099: \EG @node getenv,,, Miscellaneouses
                   1100: @subsection @code{getenv}
                   1101: @findex getenv
                   1102:
                   1103: @table @t
                   1104: @item getenv(@var{name})
                   1105: \JP :: $B4D6-JQ?t$NCM$rJV$9(B.
                   1106: \EG :: Returns the value of an environment variable.
                   1107: @end table
                   1108:
                   1109: @table @var
                   1110: @item return
                   1111: @itemx name
                   1112: \JP $BJ8;zNs(B
                   1113: \EG string
1.2       noro     1114: @end table
                   1115:
1.3       noro     1116: @itemize @bullet
                   1117: @item
                   1118: \JP $B4D6-JQ?t(B @var{name} $B$NCM$rJV$9(B.
                   1119: \EG Returns the value of an environment variable @var{name}.
                   1120: @end itemize
                   1121:
                   1122: @example
                   1123: [0] getenv("HOME");
                   1124: /home/pcrf/noro
                   1125: @end example
1.1       noro     1126:
                   1127:
                   1128:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>