[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.6

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

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