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

Annotation of OpenXM/src/asir-doc/parts/builtin/io.texi, Revision 1.1.1.1

1.1       noro        1: @node $BF~=PNO(B,,, $BAH$_9~$_H!?t(B
                      2: @section $BF~=PNO(B
                      3:
                      4: @menu
                      5: * end quit::
                      6: * load::
                      7: * which::
                      8: * output::
                      9: * bsave bload::
                     10: * bload27::
                     11: * print::
                     12: @end menu
                     13:
                     14: @node end quit,,, $BF~=PNO(B
                     15: @subsection @code{end}, @code{quit}
                     16: @findex end
                     17: @findex quit
                     18:
                     19: @table @t
                     20: @item end, quit
                     21: :: $B8=:_FI$_9~$_Cf$N%U%!%$%k$rJD$8$k(B.
                     22: $B%H%C%W%l%Y%k$K$*$$$F$O%;%C%7%g%s$r=*N;$9$k$3$H$K$J$k(B.
                     23: @end table
                     24:
                     25: @itemize @bullet
                     26: @item
                     27: @code{end}, @code{quit} $B$H$b$KL50z?t$NH!?t$G$"$k$,(B, @samp{()} $B$J$7$G(B
                     28: $B8F$S=P$9$3$H$,$G$-$k(B. $B$$$:$l$b8=:_FI$_9~$_Cf$N%U%!%$%k$rJD$8$k(B.
                     29: $B$3$l$O(B, $B%H%C%W%l%Y%k$K$*$$$F$O%;%C%7%g%s$r=*N;$5$;$k$3$H$K$J$k(B.
                     30: @item
                     31: $B%U%!%$%k$N>l9g(B, $B%U%!%$%k$N=*C<$^$GFI$a$P(B, $B<+F0E*$K%U%!%$%k$OJD$8$i$l$k(B
                     32: $B$,(B, $B%H%C%W%l%Y%k$N>l9g%W%m%s%W%H$,=P$J$$$^$^(B, $BF~NOBT$A$K$J$k$N$G(B,
                     33: $B%U%!%$%k$N=*C<$K$O(B @code{end$} $B$r=q$/$N$,K>$^$7$$(B.
                     34: @end itemize
                     35:
                     36: @example
                     37: [6] quit;
                     38: %
                     39: @end example
                     40:
                     41: @table @t
                     42: @item $B;2>H(B
                     43: @fref{load}.
                     44: @end table
                     45:
                     46: @node load,,, $BF~=PNO(B
                     47: @subsection @code{load}
                     48: @findex load
                     49:
                     50: @table @t
                     51: @item load("@var{filename}")
                     52: :: @var{filename} $B$rFI$_9~$`(B.
                     53: @end table
                     54:
                     55: @table @var
                     56: @item return
                     57: (1|0)
                     58: @item filename
                     59: $B%U%!%$%kL>(B ($B%Q%9L>(B)
                     60: @end table
                     61:
                     62: @itemize @bullet
                     63: @item
                     64: $B<B:]$N%W%m%0%i%`$N=q$-J}$O(B, @xref{$B%f!<%68@8l(B Asir}.
                     65:  $B%F%-%9%H%U%!%$%k$rFI$_9~$`>l9g(B, @code{cpp}
                     66: $B$rDL$9$N$G(B, C $B$N%W%m%0%i%`F1MM(B @code{#include}, @code{#define} $B$r;H$&$3$H$,$G$-$k(B.
                     67: @item
                     68: $B;XDj$7$?%U%!%$%k$,B8:_$7$?;~$K$O(B 1 $B$rJV$7(B, $BB8:_$7$J$+$C$?;~$O(B 0 $B$rJV$9(B.
                     69: @item
                     70: $B%U%!%$%kL>$,(B @samp{/} $B$G;O$^$k>l9g$O@dBP%Q%9(B, @samp{.} $B$G;O$^$k>l9g$O(B
                     71: $B%+%l%s%H%G%#%l%/%H%j$+$i$NAjBP%Q%9$H8+$J$5$l$k(B. $B$=$l0J30$N>l9g(B,
                     72: $B4D6-JQ?t(B @code{ASIRLOADPATH} $B$K@_Dj$5$l$F$$$k%G%#%l%/%H%j$r:8$+$i=g$K(B
                     73: $B%5!<%A$9$k(B. $B$=$l$i$K3:Ev$9$k%U%!%$%k$,B8:_$7$J$$>l9g(B, $BI8=`%i%$%V%i%j(B
                     74: $B%G%#%l%/%H%j(B ($B$"$k$$$O4D6-JQ?t(B @code{ASIR_LIBDIR} $B$K@_Dj$5$l$F$$$k(B
                     75: $B%G%#%l%/%H%j(B) $B$b%5!<%A$9$k(B.
                     76: Windows $BHG$N>l9g(B, @code{ASIR_LIBDIR} $B$,@_Dj$5$l$F$$$J$$>l9g$K$O(B, @code{get_rootdir()/lib}
                     77: $B$r%5!<%A$9$k(B.
                     78: @item
                     79: $BFI$_9~$`%U%!%$%k$N:G8e$K(B, @code{end$} $B$,$J$$$H(B @code{load()}
                     80: $B=*N;8e$K%W%m%s%W%H$,$G$J$$$,(B, $B<B:]$K$OF~NO$r<u$1IU$1$k(B. $B$7$+$7(B,
                     81: $B:.Mp$r>7$/$*$=$l$,$"$k$N$G%U%!%$%k$N:G8e$K(B @code{end$} $B$r=q$$$F$*$/$3$H(B
                     82: $B$,K>$^$7$$(B. (@code{end;} $B$G$b$h$$$,(B, @code{end} $B$,JV$9CM(B 0 $B$,I=<($5$l$k(B
                     83: $B$?$a(B, @code{end$} $B$r$*4+$a$9$k(B. )
                     84: @item
                     85: Windows $BHG$b%G%#%l%/%H%j$N%;%Q%l!<%?$H$7$F(B @samp{/} $B$rMQ$$$k(B.
                     86: @end itemize
                     87:
                     88: @table @t
                     89: @item $B;2>H(B
                     90: @fref{end quit}, @fref{which}, @fref{get_rootdir}.
                     91: @end table
                     92:
                     93: @node which,,, $BF~=PNO(B
                     94: @subsection @code{which}
                     95: @findex which
                     96:
                     97: @table @t
                     98: @item which("@var{filename}")
                     99: :: $B0z?t(B @var{filename} $B$KBP$7(B, @code{load()} $B$,FI$_9~$`%Q%9L>$rJV$9(B.
                    100: @end table
                    101:
                    102: @table @var
                    103: @item return
                    104: $B%Q%9L>(B
                    105: @item filename
                    106: $B%U%!%$%kL>(B ($B%Q%9L>(B) $B$^$?$O(B 0
                    107: @end table
                    108:
                    109: @itemize @bullet
                    110: @item
                    111: @code{load()} $B$,%U%!%$%k$r%5!<%A$9$k<j=g$K=>$C$F%5!<%A$7(B,
                    112: $B%U%!%$%k$,B8:_$9$k>l9g$K$O%Q%9L>$rJ8;zNs$H$7$F(B, $BB8:_$7$J$$>l9g(B
                    113: $B$K$O(B 0 $B$rJV$9(B.
                    114: @item
                    115: $B%5!<%A$N<j=g$K$D$$$F$O(B @code{load()} $B$r;2>H(B.
                    116: @item
                    117: Windows $BHG$b%G%#%l%/%H%j$N%;%Q%l!<%?$H$7$F(B @samp{/} $B$rMQ$$$k(B.
                    118: @end itemize
                    119:
                    120: @example
                    121: [0] which("gr");
                    122: ./gb/gr
                    123: [1] which("/usr/local/lib/gr");
                    124: 0
                    125: [2] which("/usr/local/lib/asir/gr");
                    126: /usr/local/lib/asir/gr
                    127: @end example
                    128:
                    129: @table @t
                    130: @item $B;2>H(B
                    131: @fref{load}.
                    132: @end table
                    133:
                    134: @node output,,, $BF~=PNO(B
                    135: @subsection @code{output}
                    136: @findex output
                    137:
                    138: @table @t
                    139: @item output(["@var{filename}"])
                    140: :: $B0J9_$N=PNO@h$r(B @var{filename}$B$^$?$OI8=`=PNO$K@ZBX$($k(B.
                    141: @end table
                    142:
                    143: @table @var
                    144: @item return
                    145: 1
                    146: @item filename
                    147: $B%U%!%$%kL>(B
                    148: @end table
                    149:
                    150: @itemize @bullet
                    151: @item
                    152: @b{Asir} $B$N=PNO$rI8=`=PNO$+$i(B, $B%U%!%$%k$X$N=PNO$K@ZBX$($k(B.
                    153: $B$J$*(B, $B%U%!%$%k=PNO$N4V$O(B, $BI8=`=PNO$K$O%-!<%\!<%I$+$i$NF~NO0J30(B,
                    154: $B=PNO$5$l$J$$(B.
                    155: @item
                    156: $BJL$N%U%!%$%k=PNO$K@ZBX$($k;~$K$O(B, $B:F$S(B @code{output("@var{filename}")}
                    157: $B$r<B9T$9$k(B.
                    158: $BKt(B, $B%U%!%$%k=PNO$r=*N;$7I8=`=PNO$KLa$j$?$$;~$K$O(B, $B0z?t$J$7$G(B
                    159: @code{output()} $B$r<B9T$9$k(B.
                    160: @item
                    161: $B;XDj$7$?%U%!%$%k(B @var{filename} $B$,B8:_$7$?;~$O(B, $B$=$N%U%!%$%k$NKvHx$K(B
                    162: $BDI=q$-$5$l(B, $BB8:_$7$J$+$C$?;~$K$O(B, $B?7$?$K%U%!%$%k$r:n@.$7(B, $B$=$3$K=q$-9~$^$l$k(B.
                    163: @item
                    164: $B%U%!%$%k%M!<%`$r(B "" $B%@%V%k%/%)!<%H$J$7$G;XDj$r$7$?$j(B,
                    165: $B%f!<%6$,(B, $B=q$-9~$a$J$$%U%!%$%k$r;XDj$7$?$j$9$k$H(B,
                    166: $B%(%i!<$K$h$j%H%C%W%l%Y%k$KLa$k(B.
                    167: @item
                    168: $BF~NO$7$?$b$N$b9~$a$F%U%!%$%k$K=PNO$7$?$$>l9g$K$O(B, @code{ctrl("echo",1)}
                    169: $B$r<B9T$7$?8e$G%U%!%$%k=PNO$K@ZBX$($l$PNI$$(B.
                    170: @item
                    171: $B7W;;;~4V$J$I(B, $BI8=`%(%i!<=PNO$K=q$-=P$5$l$k$b$N$O%U%!%$%k$K$O=q$-=P$5$l$J$$(B.
                    172: @item
                    173: $BH!?t7A<0(B, $BL$Dj78?t(B (@code{vtype()} $B;2>H(B) $B$r4^$^$J$$?t<0$N%U%!%$%k$X$NFI$_=q$-$O(B,
                    174: @code{bload()}, @code{bsave()} $B$r;H$&$N$,(B, $B;~4V(B, $B6u4V$H$b$K8zN($,$h$$(B.
                    175: @item
                    176: Windows $BHG$b%G%#%l%/%H%j$N%;%Q%l!<%?$H$7$F(B @samp{/} $B$rMQ$$$k(B.
                    177: @end itemize
                    178:
                    179: @example
                    180: [83] output("afo");
                    181: fctr(x^2-y^2);
                    182: print("afo");
                    183: output();
                    184: 1
                    185: [87] quit;
                    186: % cat afo
                    187: 1
                    188: [84] [[1,1],[x+y,1],[x-y,1]]
                    189: [85] afo
                    190: 0
                    191: [86]
                    192: @end example
                    193:
                    194: @table @t
                    195: @item $B;2>H(B
                    196: @fref{ctrl}, @fref{bsave bload}.
                    197: @end table
                    198:
                    199: @node bsave bload,,, $BF~=PNO(B
                    200: @subsection @code{bsave}, @code{bload}
                    201: @findex bsave
                    202: @findex bload
                    203:
                    204: @table @t
                    205: @item bsave(@var{obj},"@var{filename}")
                    206: :: @var{filename} $B$K(B @var{obj} $B$r%P%$%J%j7A<0$G=q$-9~$`(B.
                    207: @item bsave("@var{filename}")
                    208: :: @var{filename} $B$+$i?t<0$r%P%$%J%j7A<0$GFI$_9~$`(B.
                    209: @end table
                    210:
                    211: @table @var
                    212: @item return
                    213: @code{bsave()} : 1, @code{bload()} : $BFI$_9~$s$@?t<0(B
                    214: @item obj
                    215: $BH!?t7A<0(B, $BL$Dj78?t$r4^$^$J$$G$0U$N?t<0(B
                    216: @item filename
                    217: $B%U%!%$%kL>(B
                    218: @end table
                    219:
                    220: @itemize @bullet
                    221: @item
                    222: @code{bsave()} $B$OFbIt7A<0$r$[$\$=$N$^$^%P%$%J%j7A<0$G%U%!%$%k$K=q$-9~$`(B.
                    223: @code{bload()} $B$O(B, @code{bsave()} $B$G=q$-9~$s$@?t<0$rFI$_9~$s$GFbIt7A<0(B
                    224: $B$KJQ49$9$k(B. $B8=:_$N%$%s%W%j%a%s%F!<%7%g%s$N@)8B$K$h$j(B, $BH!?t7A<0(B, $BL$Dj78?t(B
                    225: (@code{vtype()} $B;2>H(B) $B$r4^$^$J$$%j%9%H(B, $BG[Ns$J$I$r4^$`G$0U$N?t<0$r%U%!(B
                    226: $B%$%k$KJ]B8$9$k$3$H$,$G$-$k(B.
                    227: @item
                    228: @code{output()} $B$J$I$GJ]B8$7$?>l9g(B, $BFI$_9~$_;~$K%Q!<%6$,5/F0$5$l$k$,(B,
                    229: @code{bsave()} $B$GJ]B8$7$?$b$N$r(B @code{bload()} $B$GFI$`>l9g(B, $BD>@\(B
                    230: $BFbIt7A<0$,9=@.$G$-$k$?$a(B, $B;~4VE*(B, $B6u4VE*$K8zN($,$h$$(B.
                    231: @item
                    232: $BB?9`<0$N>l9g(B, $B=q$-9~$_;~$HFI$_9~$_;~$GJQ?t=g=x$,0[$J$k>l9g$,$"$k$,(B,
                    233: $B$=$N>l9g$K$O(B, $B<+F0E*$K8=:_$NJQ?t=g=x$K$*$1$kFbIt7A<0$KJQ49$5$l$k(B.
                    234: @item
                    235: Windows $BHG$b%G%#%l%/%H%j$N%;%Q%l!<%?$H$7$F(B @samp{/} $B$rMQ$$$k(B.
                    236: @end itemize
                    237:
                    238: @example
                    239: [0] A=(x+y+z+u+v+w)^20$
                    240: [1] bsave(A,"afo");
                    241: 1
                    242: [2] B = bload("afo")$
                    243: [3] A == B;
                    244: 1
                    245: [4] X=(x+y)^2;
                    246: x^2+2*y*x+y^2
                    247: [5] bsave(X,"afo")$
                    248: [6] quit;
                    249: % asir
                    250: [0] ord([y,x])$
                    251: [1] bload("afo");
                    252: y^2+2*x*y+x^2
                    253: @end example
                    254:
                    255: @table @t
                    256: @item $B;2>H(B
                    257: @fref{output}.
                    258: @end table
                    259:
                    260: @node bload27,,, $BF~=PNO(B
                    261: @subsection @code{bload27}
                    262: @findex bload27
                    263:
                    264: @table @t
                    265: @item xxx(@var{filename})
                    266: :: $B5lHG$G:n$i$l$?(B bsave file $B$NFI$_9~$_(B
                    267: @end table
                    268:
                    269: @table @var
                    270: @item return
                    271: $BFI$_9~$s$@?t<0(B
                    272: @item filename
                    273: $B%U%!%$%kL>(B
                    274: @end table
                    275:
                    276: @itemize @bullet
                    277: @item
                    278: $B5lHG$G$O(B, $BB?G\D9@0?t$,(B, 1 $B%o!<%I(B 27 bit $B$GI=8=$5$l$F$$$?$,(B, $B?7HG$G$O(B 1 $B%o!<%I(B 32 bit
                    279: $B$KJQ99$5$l$?(B. $B$3$N$?$a(B, $B5lHG$G(B @code{bsave} $B$5$l$?%P%$%J%j%U%!%$%k$O$=$N$^$^$G$O(B
                    280: $BFI$_9~$a$J$$(B. $B$3$N$h$&$J%U%!%$%k$rFI$_9~$`$?$a$K(B @code{bload27} $B$rMQ$$$k(B.
                    281: @item
                    282: Windows $BHG$b%G%#%l%/%H%j$N%;%Q%l!<%?$H$7$F(B @samp{/} $B$rMQ$$$k(B.
                    283: @end itemize
                    284:
                    285: @table @t
                    286: @item $B;2>H(B
                    287: @fref{bsave bload}.
                    288: @end table
                    289:
                    290: @node print,,, $BF~=PNO(B
                    291: @subsection @code{print}
                    292: @findex print
                    293:
                    294: @table @t
                    295: @item print(@var{obj} [,@var{nl}])
                    296: :: @var{obj} $B$rI=<($9$k(B.
                    297: @end table
                    298:
                    299: @table @var
                    300: @item return
                    301: 0
                    302: @item obj
                    303: $BG$0U(B
                    304: @item nl
                    305: $B%U%i%0(B ($BG$0U(B)
                    306: @end table
                    307:
                    308: @itemize @bullet
                    309: @item
                    310: @var{obj} $B$rI>2A$7$FI=<($9$k(B.
                    311: @item
                    312: $BBh(B 2 $B0z?t$,$J$$$+(B, $B$^$?$O(B 0, 2 $B0J30$N>l9g(B, $B2~9T$9$k(B.
                    313: $BBh(B 2 $B0z?t$,(B 1 $B$N>l9g(B, $B2~9T$;$:(B, $B=PNO$O%P%C%U%!$K=q$-9~$^$l(B,
                    314: $B%P%C%U%!$O%U%i%C%7%e$5$l$J$$(B.
                    315: $BBh(B 2 $B0z?t$,(B 2 $B$N>l9g(B, $B2~9T$7$J$$$,%P%C%U%!$O%U%i%C%7%e$5$l$k(B.
                    316: @item
                    317: $B$3$NH!?t$NLa$jCM$O(B 0 $B$G$"$k$+$i(B, @code{print();}
                    318: $B$G<B9T$9$k$H(B, $B=PNO$N8e$K(B 0 $B$,JV$5$l$k(B.
                    319: @code{print()$} $B$H$9$l$P(B, $B:G8e$N(B 0 $B$O=PNO$5$l$J$$(B.
                    320: @item
                    321: $BJ#?t$N(B @var{obj} $B$rF1;~$K=PNO$7$?$$;~$O(B @var{obj} $B$r%j%9%H$K$9$k$H$h$$(B.
                    322: @end itemize
                    323:
                    324: @example
                    325: [8] def cat(L) @{ while ( L != [] ) @{ print(car(L),0); L = cdr(L);@} print(""); @}
                    326: [9] cat([xyz,123,"gahaha"])$
                    327: xyz123gahaha
                    328: @end example
                    329:

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