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

1.4     ! noro        1: @comment $OpenXM: OpenXM/src/asir-doc/parts/builtin/misc.texi,v 1.3 1999/12/21 02:47:33 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.
                     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
1.4     ! noro      316: $B4D6-JQ?t(B @code{LANG} $B$,@_Dj$5$l$F$$$k>l9g(B, $B$=$NCM$,(B @code{"japan"} $B$^$?$O(B
        !           317: @code{"ja_JP"} $B$G;O$^$k$J$i(B, @samp{help} $B$NBe$o$j$K(B @samp{help-jp}
        !           318: $B$K$"$k%U%!%$%k$,I=<($5$l$k(B. $B$=$&$G$J$$>l9g(B, @samp{help-eg}
        !           319: $B$K$"$k%U%!%$%k$,I=<($5$l$k(B.
        !           320: @item
1.1       noro      321: Windows $BHG$G$O(B, $B%3%^%s%I%i%$%s$+$i$N%X%k%W8F$S=P$7$OL$%5%]!<%H$@$,(B,
                    322: $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      323: \E
                    324: \BEG
                    325: @item
                    326: If invoked without argument, it displays rough usage of @b{Asir}.
                    327: @item
                    328: If a function name is given and if there exists a file with the
                    329: same name in the directory @samp{help} under standard library directory,
                    330: the file is displayed by a command set to the environmental variable
                    331: @code{PAGER} or else command @samp{more}.
1.4     ! noro      332: @item
        !           333: If the @code{LANG} environment variable is set and its value
        !           334: begins with @code{"japan"} or @code{"ja_JP"}, then the file in
        !           335: @samp{help-jp} is displayed. If its value does not begin with
        !           336: @code{"japan"} or @code{"ja_JP"}, then the file in @samp{help-eg}
        !           337: is displayed.
1.3       noro      338: @item
                    339: On Windows HTML-style help is available from the menu.
                    340: \E
1.1       noro      341: @end itemize
                    342:
1.3       noro      343: \JP @node time,,, $B$=$NB>(B
                    344: \EG @node time,,, Miscellaneouses
1.1       noro      345: @subsection @code{time}
                    346: @findex time
                    347:
                    348: @table @t
                    349: @item time()
1.3       noro      350: \JP :: $B%;%C%7%g%s3+;O$+$i8=:_$^$G$N(B CPU $B;~4V$*$h$S(B GC $B;~4V$rI=<($9$k(B
                    351: \BEG
                    352: :: Returns a four element list consisting of
                    353: total CPU time, GC time, the elapsed time
                    354: and also total memory quantities requested
                    355: from the start of current @b{Asir} session.
                    356: \E
1.1       noro      357: @end table
                    358:
                    359: @table @var
                    360: @item return
1.3       noro      361: \JP $B%j%9%H(B
                    362: \EG list
1.1       noro      363: @end table
                    364:
                    365: @itemize @bullet
1.3       noro      366: \BJP
1.1       noro      367: @item
                    368: CPU $B;~4V$*$h$S(B GC $B;~4V$NI=<($K4X$9$k%3%^%s%I$G$"$k(B.
                    369: @item
                    370: GC $B;~4V$H$O(B, $B%,!<%Y%8%3%l%/%?$K$h$j>CHq$5$l$?$H8+$J$5$l$k;~4V(B,
                    371: 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.
                    372: @item
                    373: @code{time()} $B$O0z?t$J$7$G(B, $B%;%C%7%g%s3+;O$+$i8=:_$^$G$N(B CPU $B;~4V(B,
                    374: 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
                    375: $B8=:_$^$G$N7P2a;~4V$NI=<($r$9$k(B.
                    376: $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)]}
                    377: $B$J$k%j%9%H$rJV$9(B. 1 $B%o!<%I$ODL>o(B 4 $B%P%$%H$G$"$k(B.
                    378: @item
                    379: $B7W;;$N<B9T3+;O;~(B, $B=*N;;~$N(B @code{time()} $B$+$i(B, $B$=$N7W;;$KBP$9$k(B
                    380: CPU $B;~4V(B, GC $B;~4V$,$o$+$k(B.
                    381: @item
                    382: $B%a%b%jNL$OB?G\D9?t$G$O$J$$$?$a(B, $B$"$kCM$r1[$($k$HL50UL#$JCM$H$J$k$?$a(B
                    383: $B$"$/$^$G$bL\0B$H$7$FMQ$$$k$Y$-$G$"$k(B.
                    384: @item
                    385: @code{ctrl()} $B$d(B @code{cputime()} $B$K$h$j(B @code{cputime} $B%9%$%C%A$,(B
                    386: 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,
                    387: $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
                    388: $B7W;;$KBP$9$k7W;;;~4V$rCN$j$?$$;~$K$O(B, @code{time()} $B$J$I$r;H$&(B
                    389: $BI,MW$,$"$k(B.
                    390: @item
                    391: @code{getrusage()} $B$,;H$($k(B UNIX $B>e$G$O(B @code{time()} $B$O?.Mj@-$N$"$kCM(B
                    392: $B$rJV$9$,(B, Windows 95, 98 $B>e$G$O;~9o$rMQ$$$k$[$+J}K!$,$J$$$?$a7P2a;~4V$=$N$b$N(B
                    393: $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      394: \E
                    395: \BEG
                    396: @item
                    397: These are commands regarding CPU time and GC time.
                    398: @item
                    399: The GC time is the time regarded to spent by the garbage collector,
                    400: and the CPU time is the time defined by subtracting the GC time from
                    401: the total time consumed by command @b{Asir}.  Their unit is `second.'
                    402: @item
                    403: Command @code{time()} returns total CPU time and GC time measured
                    404: from the start of current @b{Asir} session. It also returns the elapsed
                    405: time. Time unit is `second.'
                    406: Moreover, it returns total memory quantities in words
                    407: (usually 4 bytes) which are requested
                    408: to the memory manager from the beginning of the current session.
                    409: The return value is a list and the format is @code{[CPU time, GC time,
                    410: Memory, Elapsed time]}.
                    411: @item
                    412: You can find the CPU time and GC time for some computation by taking
                    413: the difference of the figure reported by @code{time()} at the beginning
                    414: and the ending of the computation.
                    415: @item
                    416: Since arbitrary precision integers are NOT used for counting
                    417: the total amount of memory request, the number will eventually happen
                    418: to become meaningless due to integer overflow.
                    419: @item
                    420: When @code{cputime} switch is active by @code{ctrl()} or by
                    421: @code{cputime()}, the execution time will be displayed after every
                    422: evaluation of top level statement.
                    423: In a program, however, in order to know the execution time for a
                    424: sequence of computations, you have to use @code{time()} command, for
                    425: an example.
                    426: @item
                    427: On UNIX, if @code{getrusage()} is available, @code{time()} reports
                    428: reliable figures. On Windows NT it also gives reliable CPU time.
                    429: However, on Windows 95/98, the reported time is nothing but
                    430: the elapsed time of the real world.
                    431: Therefore, the time elapsed in the debug-mode and the time of waiting
                    432: for a reply to interruption prompting are added to the elapsed time.
                    433: \E
1.1       noro      434: @end itemize
                    435:
                    436: @example
                    437: [72] T0=time();
                    438: [2.390885,0.484358,46560,9.157768]
                    439: [73] G=hgr(katsura(4),[u4,u3,u2,u1,u0],2)$
                    440: [74] T1=time();
                    441: [8.968048,7.705907,1514833,63.359717]
                    442: [75] ["CPU",T1[0]-T0[0],"GC",T1[1]-T0[1]];
                    443: [CPU,6.577163,GC,7.221549]
                    444: @end example
                    445:
                    446: @table @t
1.3       noro      447: \JP @item $B;2>H(B
                    448: \EG @item References
1.1       noro      449: @fref{cputime tstart tstop}.
                    450: @end table
                    451:
1.3       noro      452: \JP @node cputime tstart tstop,,, $B$=$NB>(B
                    453: \EG @node cputime tstart tstop,,, Miscellaneouses
1.1       noro      454: @subsection @code{cputime}, @code{tstart}, @code{tstop}
                    455: @findex cputime
                    456: @findex tstart
                    457: @findex tstop
                    458:
                    459: @table @t
                    460: @item cputime(@var{onoff})
1.3       noro      461: \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.
                    462: \BEG
                    463: :: Stop displaying @code{cputime} if its argument is 0, otherwise
                    464: start displaying @code{cputime} after every top level evaluation of
                    465: Asir command.
                    466: \E
1.1       noro      467: @item tstart()
1.3       noro      468: \JP :: CPU time $B7WB,3+;O(B.
                    469: \EG :: Resets and starts timer for CPU time and GC time.
1.1       noro      470: @item tstop()
1.3       noro      471: \JP :: CPU time $B7WB,=*N;$*$h$SI=<((B.
                    472: \BEG
                    473: :: Stops timer and then displays CPU time GC time elapsed from the
                    474: last time when timer was started.
                    475: \E
1.1       noro      476: @end table
                    477:
                    478: @table @var
                    479: @item return
                    480: 0
                    481: @item onoff
1.3       noro      482: \JP $B%U%i%0(B ($BG$0U(B)
                    483: \EG flag (arbitrary)
1.1       noro      484: @end table
                    485:
                    486: @itemize @bullet
1.3       noro      487: \BJP
1.1       noro      488: @item
                    489: @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.
                    490: @item
                    491: @code{tsart} $B$O0z?t$J$7(B, @samp{()} $B$J$7$G(B, CPU time $B7WB,$r3+;O$9$k(B.
                    492: @item
                    493: @code{tstop} $B$O0z?t$J$7(B, @samp{()} $B$J$7$G(B, CPU time $B7WB,$r=*N;(B,
                    494: $B$*$h$SI=<($9$k(B.
                    495: @item
                    496: @code{cputime(@var{onoff})} $B$O(B @code{ctrl("cputime",@var{onoff})} $B$HF1$8$G$"$k(B.
                    497: @item
                    498: @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
                    499: $B$?$a(B, $B$=$N$h$&$J2DG=@-$,$"$k>l9g$K$O(B, @code{time()} $B$K$h$k7WB,$r9T$&(B
                    500: $BI,MW$,$"$k(B.
                    501: @item
                    502: @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
                    503: $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,
                    504: $B7W;;=*N;A0$K%G%P%C%,$KF~$C$F(B @code{cputime(1)} $B$r<B9T$5$;$l$P7W;;;~4V$O(B
                    505: $BI=<($5$l$k(B.
1.3       noro      506: \E
                    507: \BEG
                    508: @item
                    509: Command @code{cputime()} with NON-ZERO argument enables @b{Asir} to display
                    510: CPU time and GC time after every evaluation of top level @b{Asir} command.
                    511: The command with argument 0 disables displaying them.
                    512: @item
                    513: Command @code{tstart()} starts measuring CPU time and GC time without
                    514: arguments.  The parentheses @samp{()} may be omitted.
                    515: @item
                    516: Command @code{tstop()} stops measuring CPU time and GC time and displays
                    517: them without arguments. The parentheses @samp{()} may be omitted.
                    518: @item
                    519: Command @code{cputime(@var{onoff})} has same meaning as
                    520: @code{ctrl("cputime",@var{onoff})}.
                    521: @item
                    522: Nested use of @code{tstart()} and @code{tstop()} is not expected.
                    523: If such an effect is desired, use @code{time()}.
                    524: @item
                    525: On and off states by @code{cputime()} have effects only to displaying
                    526: mode.  Time for evaluation of every top level statement is always
                    527: measured.
                    528: Therefore, even after a computation has already started,
                    529: you can let @b{Asir} display the timings, whenever you enter
                    530: the debug-mode and execute @code{cputime(1)}.
                    531: \E
1.1       noro      532: @end itemize
                    533:
                    534: @example
                    535: [49] tstart$
                    536: [50] fctr(x^10-y^10);
                    537: [[1,1],[x+y,1],[x^4-y*x^3+y^2*x^2-y^3*x+y^4,1],[x-y,1],
                    538: [x^4+y*x^3+y^2*x^2+y^3*x+y^4,1]]
                    539: [51] tstop$
                    540: 80msec + gc : 40msec
                    541: @end example
                    542:
                    543: @table @t
1.3       noro      544: \JP @item $B;2>H(B
                    545: \EG @item References
1.1       noro      546: @fref{time}, @fref{ctrl}.
                    547: @end table
                    548:
1.3       noro      549: \JP @node heap,,, $B$=$NB>(B
                    550: \EG @node heap,,, Miscellaneouses
1.1       noro      551: @subsection @code{heap}
                    552: @findex heap
                    553:
                    554: @table @t
                    555: @item heap()
1.3       noro      556: \JP :: $B8=:_$N%R!<%W$NBg$-$5$rJV$9(B. ($BC10L(B:$B%P%$%H(B)
                    557: \EG :: Heap area size currently in use.
1.1       noro      558: @end table
                    559:
                    560: @table @var
                    561: @item return
1.3       noro      562: \JP $B<+A3?t(B
                    563: \EG non-negative integer
1.1       noro      564: @end table
                    565:
                    566: @itemize @bullet
1.3       noro      567: \BJP
1.1       noro      568: @item
                    569: $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
                    570: $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
                    571: $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
                    572: $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
                    573: $B%9%o%C%W%(%j%"$X$NFI$_=q$-$,$[$H$s$I$N7W;;;~4V$r@j$a$k$3$H$K$J$k(B.
                    574: @item
                    575: $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,
                    576: GC $B<gBN$N@_Dj$r9T$C$F$*$/I,MW$,$"$k(B.
1.3       noro      577: \E
                    578: \BEG
                    579: @item
                    580: Command @code{heap()} returns an integer which is the byte size
                    581: of current @b{Asir} heap area.
                    582:
                    583: Heap is a memory area where various data for expressions and
                    584: user programs of @b{Asir} and is managed by the garbage collector.
                    585: While @b{Asir} is running, size of the heap is monotonously
                    586: non-decreasing against the time elapsed.  If it happens to exceed the
                    587: real memory size, most (real world) time is consumed for swapping between
                    588: real memory and disk memory.
                    589: @item
                    590: For a platform with little real memory, it is recommended to set up
                    591: @b{Asir} configuration tuned for GC functions by @code{-adj} option
                    592: at the activation of @b{Asir}. (@xref{Command line options}.)
                    593: \E
1.1       noro      594: @end itemize
                    595:
                    596: @example
                    597: % asir -adj 16
                    598: [0] load("fctrdata")$
                    599: 0
                    600: [97] cputime(1)$
                    601: 0msec
                    602: [98] heap();
                    603: 524288
                    604: 0msec
                    605: [99] fctr(Wang[8])$
                    606: 3.190sec + gc : 3.420sec
                    607: [100] heap();
                    608: 1118208
                    609: 0msec
                    610: [101] quit;
                    611: % asir
                    612: [0] load("fctrdata")$
                    613: 0
                    614: [97] cputime(1)$
                    615: 0msec
                    616: [98] heap();
                    617: 827392
                    618: 0msec
                    619: [99] fctr(Wang[8])$
                    620: 3.000sec + gc : 1.180sec
                    621: [100] heap();
                    622: 1626112
                    623: 0msec
                    624: [101] quit;
                    625: @end example
                    626:
                    627: @table @t
1.3       noro      628: \JP @item $B;2>H(B
                    629: \EG @item References
                    630: \JP @fref{$B%3%^%s%I%i%$%s%*%W%7%g%s(B}.
                    631: \EG @fref{Command line options}.
1.1       noro      632: @end table
                    633:
1.3       noro      634: \JP @node version,,, $B$=$NB>(B
                    635: \EG @node version,,, Miscellaneouses
1.1       noro      636: @subsection @code{version}
                    637: @findex version
                    638:
                    639: @table @t
                    640: @item version()
1.3       noro      641: \JP :: @b{Asir} $B$N%P!<%8%g%s$rJV$9(B.
                    642: \EG :: Version identification number of  @b{Asir}.
1.1       noro      643: @end table
                    644:
                    645: @table @var
                    646: @item return
1.3       noro      647: \JP $B<+A3?t(B
                    648: \EG integer
1.1       noro      649: @end table
                    650:
                    651: @itemize @bullet
1.3       noro      652: \BJP
1.1       noro      653: @item
1.3       noro      654: @b{Asir} $B$N%P!<%8%g%s$r<+A3?t$GJV$9(B.
                    655: \E
                    656: \BEG
                    657: Command @code{version()} returns the version identification number
                    658: , an integer of @b{Asir} in use.
                    659: \E
1.1       noro      660: @end itemize
                    661:
                    662: @example
                    663: [0] version();
1.3       noro      664: 991214
1.1       noro      665: @end example
                    666:
1.3       noro      667: \JP @node shell,,, $B$=$NB>(B
                    668: \EG @node shell,,, Miscellaneouses
1.1       noro      669: @subsection @code{shell}
                    670: @findex shell
                    671:
                    672: @table @t
                    673: @item shell(@var{command})
1.3       noro      674: \JP :: @var{command} $B$r%7%'%k%3%^%s%I$H$7$F<B9T$9$k(B.
                    675: \EG :: Execute shell commands described by a string @var{command}.
1.1       noro      676: @end table
                    677:
                    678: @table @var
                    679: @item return
1.3       noro      680: \JP $B<+A3?t(B
                    681: \EG integer
1.1       noro      682: @item command
1.3       noro      683: \JP $BJ8;zNs(B
                    684: \EG string
1.1       noro      685: @end table
                    686:
                    687: @itemize @bullet
1.3       noro      688: \BJP
1.1       noro      689: @item
                    690: @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.
                    691: $B%7%'%k$N=*N;%9%F!<%?%9$rJV$9(B.
1.3       noro      692: \E
                    693: \BEG
                    694: Execute shell commands described by a string @var{command}
                    695: by a C function @code{system()}.  This returns the exit status of shell
                    696: as its return value.
                    697: \E
1.1       noro      698: @end itemize
                    699:
                    700: @example
                    701: [0] shell("ls");
                    702: alg             da              katsura         ralg            suit
                    703: algt            defs.h          kimura          ratint          test
                    704: alpi            edet            kimura3         robot           texput.log
                    705: asir.o          fee             mfee            sasa            wang
                    706: asir_symtab     gr              mksym           shira           wang_data
                    707: base            gr.h            mp              snf1            wt
                    708: bgk             help            msubst          solve
                    709: chou            hom             p               sp
                    710: const           ifplot          proot           strum
                    711: cyclic          is              r               sugar
                    712: 0
                    713: [1]
                    714: @end example
                    715:
1.3       noro      716: \JP @node map,,, $B$=$NB>(B
                    717: \EG @node map,,, Miscellaneouses
1.1       noro      718: @subsection @code{map}
                    719: @findex map
                    720:
                    721: @table @t
                    722: @item map(@var{function},@var{arg0},@var{arg1},...)
1.3       noro      723: \JP :: $B%j%9%H(B, $BG[Ns$N3FMWAG$KH!?t$rE,MQ$9$k(B.
                    724: \EG :: Applies a function to each member of a list or an array.
1.1       noro      725: @end table
                    726:
                    727: @table @var
                    728: @item return
1.3       noro      729: \JP @var{arg0} $B$HF1$87?$N%*%V%8%'%/%H(B
                    730: \EG an object of the same type as @var{arg0}.
1.1       noro      731: @item function
1.3       noro      732: \JP $BH!?tL>(B
                    733: \EG the name of a function
1.1       noro      734: @item arg0
1.3       noro      735: \JP $B%j%9%H(B, $B%Y%/%H%k(B, $B9TNs(B
                    736: \EG list, vector or matrix
1.1       noro      737: @item arg1, ...
1.3       noro      738: \JP $BG$0U(B ($B;D$j$N0z?t(B)
                    739: \EG arbitrary (the rest of arguments)
1.1       noro      740: @end table
                    741:
                    742: @itemize @bullet
1.3       noro      743: \BJP
1.1       noro      744: @item
                    745: @var{arg0} $B$N3FMWAG$r:G=i$N0z?t(B, @var{arg1} $B0J2<$N;D$j$N0z?t$H$7$F(B
                    746: $BH!?t(B @var{function} $B$r8F$S=P$7(B, @var{arg0} $B$NBP1~$9$kMWAG$N0LCV$K(B
                    747: $BH!?t8F$S=P$7$N7k2L$,F~$C$?F1$87?$N%*%V%8%'%/%H$r@8@.$7$FJV$9(B.
                    748: @item
                    749: @var{function} $B$O(B, $B%@%V%k%/%)!<%H$N$J$$H!?tL>$rMQ$$$k(B.
                    750: @item
                    751: @var{function} $B$K%W%m%0%i%`JQ?t$O;H$($J$$(B.
                    752: @item
                    753: @var{arg0} $B$,%j%9%H(B, $B%Y%/%H%k(B, $B9TNs0J30$N>l9g(B, $BC1$K(B @var{arg0},
                    754: @var{arg1}, ... $B$r0z?t$H$7$F(B @var{function} $B$r8F$S=P$7$=$N(B
                    755: $B7k2L$rJV$9(B.
1.3       noro      756: \E
                    757: \BEG
                    758: @item
                    759: Returns an object of the same type as @var{arg0}. Each member of the
                    760: returned object is the return value of a function call where the first
                    761: argument is the member of @var{arg0} corresponding to the member in
                    762: the returned object and the rest of the argument are @var{arg1},
                    763: @dots{}.
                    764: @item
                    765: @var{function} is a function name itself without @samp{"}.
                    766: @item
                    767: A program variable cannot be used as @var{function}.
                    768: @item
                    769: If @var{arg0} is neither list nor array this function simply
                    770: returns the value of @var{function}(@var{arg0},@var{arg1},@dots{}).
                    771: \E
1.1       noro      772: @end itemize
                    773:
                    774: @example
                    775: [82] def afo(X) @{ return X^3; @}
                    776: [83] map(afo,[1,2,3]);
                    777: [1,8,27]
                    778: @end example
                    779:
1.3       noro      780: \JP @node flist,,, $B$=$NB>(B
                    781: \EG @node flist,,, Miscellaneouses
1.1       noro      782: @subsection @code{flist}
                    783: @findex flist
                    784:
                    785: @table @t
                    786: @item flist()
1.3       noro      787: \JP :: $B8=:_Dj5A$5$l$F$$$kH!?tL>$rJ8;zNs%j%9%H$H$7$FJV$9(B.
                    788: \EG :: Returns the list of function names currently defined.
1.1       noro      789: @end table
                    790:
                    791: @table @var
                    792: @item return
1.3       noro      793: \JP $BJ8;zNs$N%j%9%H(B
                    794: \EG list of character strings
1.1       noro      795: @end table
                    796:
                    797: @itemize @bullet
1.3       noro      798: \BJP
1.1       noro      799: @item
                    800: $B8=:_Dj5A$5$l$F$$$kAH$_9~$_H!?t(B, $B%f!<%6Dj5AH!?t$NH!?tL>$rJ8;zNs%j%9%H(B
                    801: $B$H$7$FJV$9(B.
                    802: @item
                    803: $B%7%9%F%`H!?t$N8e$K%f!<%6Dj5AH!?t$,B3$/(B.
1.3       noro      804: \E
                    805: \BEG
                    806: @item
                    807: Returns the list of names of built-in functions and user defined functions
                    808: currently defined. The return value is a list of character strings.
                    809: @item
                    810: The names of built-in functions are followed by those of user defined
                    811: functions.
                    812: \E
1.1       noro      813: @end itemize
                    814:
                    815: @example
                    816: [77] flist();
                    817: [defpoly,newalg,mainalg,algtorat,rattoalg,getalg,alg,algv,...]
                    818: @end example
                    819:
1.3       noro      820: \JP @node delete_history,,, $B$=$NB>(B
                    821: \EG @node delete_history,,, Miscellaneouses
1.1       noro      822: @subsection @code{delete_history}
                    823: @findex delete_history
                    824:
                    825: @table @t
                    826: @item delete_history([@var{index}])
1.3       noro      827: \JP :: $B%R%9%H%j$r>C5n$9$k(B.
                    828: \EG :: Deletes the history.
1.1       noro      829: @end table
                    830:
                    831: @table @var
                    832: @item return
                    833: 0
                    834: @item index
1.3       noro      835: \JP $B>C5n$7$?$$%R%9%H%j$NHV9f(B
                    836: \EG Index of history to be deleted.
1.1       noro      837: @end table
                    838:
                    839: @itemize @bullet
1.3       noro      840: \BJP
1.1       noro      841: @item
                    842: $B0z?t$,$J$$$H$-(B, $B$3$l$^$G7W;;$7$?%R%9%H%j$rA4$F>C5n$9$k(B.
                    843: @item
                    844: $B0z?t$,$"$k$H$-(B, $B$=$NHV9f$N7k2L$N$_>C5n$9$k(B.
                    845: @item
                    846: $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
                    847: $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,
                    848: $B%,!<%Y%C%8%3%l%/%7%g%s$N:]$K$b$3$N<0$,@8$-;D$k$3$H$r0UL#$9$k(B.
                    849: @item
                    850: $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
                    851: $B$?$a(B, @code{bsave()} $B$J$I$G%U%!%$%k$K%;!<%V$7$F(B, @code{delete_history()}
                    852: $B$K$h$j%R%9%H%j$r>C5n$7$F$*$/$N$,M-8z$G$"$k(B.
1.3       noro      853: \E
                    854: \BEG
                    855: @item
                    856: Deletes all the histories without an argument.
                    857: @item
                    858: Deletes the history with index @var{index} if specified.
                    859: @item
                    860: A history is an expression which has been obtained by evaluating an input
                    861: given for a prompt with an index. It can be taken out by @code{@@@var{index}},
                    862: which means that the expression survives garbage collections.
                    863: @item
                    864: A large history may do harm in the subsequent memory management and
                    865: deleting the history by @code{delete_history()}, after saving it in a file
                    866: by @code{bsave()}, is often effective.
                    867: \E
1.1       noro      868: @end itemize
                    869:
                    870: @example
                    871: [0] (x+y+z)^100$
                    872: [1] @@0;
                    873: ...
                    874: [2] delete_history(0);
                    875: [3] @@0;
                    876: 0
                    877: @end example
                    878:
1.3       noro      879: \JP @node get_rootdir,,, $B$=$NB>(B
                    880: \EG @node get_rootdir,,, Miscellaneouses
1.1       noro      881: @subsection @code{get_rootdir}
                    882: @findex get_rootdir
                    883:
                    884: @table @t
                    885: @item get_rootdir()
1.3       noro      886: \JP :: Asir $B$N%k!<%H%G%#%l%/%H%jL>$r<h$j=P$9(B
                    887: \EG :: Gets the name of @b{Asir} root directory.
1.1       noro      888: @end table
                    889:
                    890: @table @var
                    891: @item return
1.3       noro      892: \JP $BJ8;zNs(B
                    893: \EG string
1.1       noro      894: @end table
                    895:
                    896: @itemize @bullet
1.3       noro      897: \BJP
1.1       noro      898: @item
                    899: 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
                    900: $B$K$O(B @samp{/usr/local/lib/asir} $B$rJV$9(B.
                    901: @item
                    902: 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)
                    903: $B$N?F%G%#%l%/%H%j$,JV$5$l$k(B.
                    904: @item
                    905: $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
                    906: $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      907: \E
                    908: \BEG
                    909: @item
                    910: On UNIX it returns the value of an environment variable @code{ASIR_LIBDIR}
                    911: or @samp{/usr/local/lib/asir} if @code{ASIR_LIBDIR} is not set.
                    912: @item
                    913: On Windows the name of @b{Asir} root directory is returned.
                    914: @item
                    915: By using relative path names from the value of this function,
                    916: one can write programs which contain file operations independent
                    917: of the install directory.
                    918: \E
1.1       noro      919: @end itemize
1.2       noro      920:
                    921:
1.3       noro      922: \JP @node getopt,,, $B$=$NB>(B
                    923: \EG @node getopt,,, Miscellaneouses
1.2       noro      924: @subsection @code{getopt}
                    925: @findex getopt
                    926:
                    927: @table @t
                    928: @item getopt(@var{key})
1.3       noro      929: \JP :: $B%*%W%7%g%s$NCM$rJV$9(B.
                    930: \EG :: Returns the value of an option.
1.2       noro      931: @end table
                    932:
                    933: @table @var
                    934: @item return
1.3       noro      935: \JP $B%*%V%8%'%/%H(B
                    936: \EG object
1.2       noro      937: @end table
                    938:
                    939: @itemize @bullet
1.3       noro      940: \BJP
1.2       noro      941: @item
                    942: $B%f!<%6Dj5A4X?t$O(B, $B8GDj8D?t0z?t$G$7$+@k8@$G$-$J$$(B. $B%f!<%6Dj5A4X?t$G(B
                    943: $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
                    944: $B$,$"$k(B (@pxref{$B%*%W%7%g%s;XDj(B}). $B;XDj$5$l$?%*%W%7%g%s$r4X?tFb$G(B
                    945: $B<u$1<h$k$?$a$K$3$N4X?t$rMQ$$$k(B.
                    946: @item
                    947: $B4X?t8F$S=P$7$N:]$K(B @var{key} $B$,%*%W%7%g%s$H$7$F;XDj$5$l$F$$$k(B
                    948: $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
                    949: ($B7?<1JL;R(B -1) $B$rJV$9(B. @code{getopt()} $B$,JV$7$?CM$N7?$r(B @code{type()}
                    950: $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.
                    951: @item
                    952: $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,
                    953:
                    954: @example
                    955: xxx(A,B,C,D|x=X,y=Y,z=Z)
                    956: @end example
                    957:
                    958: $B$H$$$&Iw$K(B, @samp{|} $B$KB3$/(B, @var{key=value} $B$N(B @samp{,} $B$G6h@Z$i$l$?(B
                    959: $BJB$S$rCV$/$3$H$G9T$&(B.
1.3       noro      960: \E
                    961: \BEG
                    962: @item
                    963: When a user defined function is called, the number of arguments
                    964: must be equal to that in the declaration of the function.
                    965: A function with indefinite number of arguments can be realized
                    966: by using @var{options} (@pxref{option}).
                    967: The value of a specified option is retrieved by @code{getopt}.
                    968: @item
                    969: If an option @var{key} is specified upon a function call, @code{getopt}
                    970: return the value of the option. If such an option is not specified,
                    971: the it returns an object of VOID type whose object identifier is
                    972: -1. By examining the type of the returned value with @code{type()},
                    973: one knows whether the option is set or not.
                    974: @item
                    975: Options are specified as follows:
                    976:
                    977: @example
                    978: xxx(A,B,C,D|x=X,y=Y,z=Z)
                    979: @end example
                    980:
                    981: That is, the options are specified by a sequence of @var{key=value} seperated
                    982: by @samp{,}, after @samp{|}.
                    983: \E
1.2       noro      984: @end itemize
                    985:
                    986: @table @t
1.3       noro      987: \JP @item $B;2>H(B
                    988: \EG @item References
                    989: \JP @fref{$B%*%W%7%g%s;XDj(B}, @fref{type}.
                    990: \EG @fref{option}, @fref{type}.
                    991: @end table
                    992:
                    993: \JP @node getenv,,, $B$=$NB>(B
                    994: \EG @node getenv,,, Miscellaneouses
                    995: @subsection @code{getenv}
                    996: @findex getenv
                    997:
                    998: @table @t
                    999: @item getenv(@var{name})
                   1000: \JP :: $B4D6-JQ?t$NCM$rJV$9(B.
                   1001: \EG :: Returns the value of an environment variable.
                   1002: @end table
                   1003:
                   1004: @table @var
                   1005: @item return
                   1006: @itemx name
                   1007: \JP $BJ8;zNs(B
                   1008: \EG string
1.2       noro     1009: @end table
                   1010:
1.3       noro     1011: @itemize @bullet
                   1012: @item
                   1013: \JP $B4D6-JQ?t(B @var{name} $B$NCM$rJV$9(B.
                   1014: \EG Returns the value of an environment variable @var{name}.
                   1015: @end itemize
                   1016:
                   1017: @example
                   1018: [0] getenv("HOME");
                   1019: /home/pcrf/noro
                   1020: @end example
1.1       noro     1021:
                   1022:
                   1023:

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