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