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

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

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