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

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

1.1       noro        1: @node $B%j%9%H$N1i;;(B,,, $BAH$_9~$_H!?t(B
                      2: @section $B%j%9%H$N1i;;(B
                      3:
                      4: @menu
                      5: * car cdr cons append reverse length::
                      6: @end menu
                      7:
                      8: @node car cdr cons append reverse length,,, $B%j%9%H$N1i;;(B
                      9: @subsection @code{car}, @code{cdr}, @code{cons}, @code{append}, @code{reverse}, @code{length}
                     10: @findex car
                     11: @findex cdr
                     12: @findex cons
                     13: @findex append
                     14: @findex reverse
                     15: @findex length
                     16:
                     17: @table @t
                     18: @item car(@var{list})
                     19: :: $B6u$G$J$$(B @var{list} $B$N@hF,MWAG(B.
                     20: @item cdr(@var{list})
                     21: :: $B6u$G$J$$(B @var{list} $B$+$i@hF,MWAG$r<h$j=|$$$?%j%9%H(B.
                     22: @item cons(@var{obj},@var{list})
                     23: :: @var{list} $B$N@hF,$K(B @var{obj} $B$rIU$12C$($?%j%9%H(B.
                     24: @item @t{append}(@var{list1},@var{list2})
                     25: :: @var{list1} $B$H(B @var{list2} $B$r$3$N=g$K(B 1 $B$D$K$7$?%j%9%H(B.
                     26: @item @t{reverse}(@var{list})
                     27: :: @var{list} $B$r5U=g$K$7$?%j%9%H(B.
                     28: @item length(@var{list})
                     29: :: @var{list} $B$ND9$5(B.
                     30: @end table
                     31:
                     32: @table @var
                     33: @item return
                     34: @code{car()} : $BG$0U(B, @code{cdr()}, @code{cons()}, @code{append()}, @code{reverse()} : $B%j%9%H(B,  @code{length()} : $B<+A3?t(B
                     35: @item list,list1,list2
                     36: $B%j%9%H(B
                     37: @item obj
                     38: $BG$0U(B
                     39: @end table
                     40:
                     41: @itemize @bullet
                     42: @item
                     43: $B%j%9%H$O(B @t{[}@var{obj1},@var{obj2},...@t{]} $B$HI=$5$l$k(B. @var{obj1} $B$,(B
                     44: $B@hF,MWAG$G$"$k(B.
                     45: @item
                     46: @code{car()} $B$O(B, $B6u$G$J$$(B @var{list} $B$N@hF,MWAG$r=PNO$9$k(B. $B6u%j%9%H$,F~NO$5$l$?>l9g$O(B, $B6u%j%9%H$,=PNO$5$l$k(B.
                     47: @item
                     48: @code{cdr()} $B$O(B, $B6u$G$J$$(B @var{list} $B$+$i@hF,MWAG$r<h$j=|$$$?%j%9%H$r=PNO$9$k(B. $B6u%j%9%H$,F~NO$5$l$?>l9g$O(B, $B6u%j%9%H$,=PNO$5$l$k(B.
                     49: @item
                     50: @code{cons()} $B$O(B,  @var{list} $B$N@hF,$K(B @var{obj} $B$rIU$12C$($?%j%9%H$r=PNO$9$k(B.
                     51: @item
                     52: @code{append()} $B$O(B, @var{list1} $B$NMWAG$H(B @var{list2} $B$N$9$Y$F$NMWAG$r7k9g$5$;$?%j%9%H(B [@var{list1} $B$NMWAG$NJB$S(B,@var{list2} $B$NMWAG$NJB$S(B] $B$r=PNO$9$k(B.
                     53: @item
                     54: @code{reverse()} $B$O(B, @var{list} $B$r5U=g$K$7$?%j%9%H$r=PNO$9$k(B.
                     55: @item
                     56: @code{length()} $B$O(B, @var{list} $B$ND9$5$r=PNO$9$k(B. $B%Y%/%H%k5Z$S9TNs$NMWAG$N8D?t$O(B, @code{size()} $B$rMQ$$$k(B.
                     57: @item
                     58: $B%j%9%H$OFI$_=P$7@lMQ$G(B, $BMWAG$NF~$lBX$($O$G$-$J$$(B.
                     59: @item
                     60: $B%j%9%H$N(B @var{n} $BHVL\$NMWAG$N<h$j=P$7$O(B, @code{cdr()} $B$r(B @var{n} $B2sE,MQ(B
                     61: $B$7$?8e(B @code{car()} $B$rE,MQ$9$k$3$H$K$h$j2DG=$G$"$k$,(B, $BJXK!$H$7$F(B,
                     62: $B%Y%/%H%k(B, $B9TNs$J$I$NG[Ns$HF1MM(B, $B%$%s%G%C%/%9(B @code{[@var{n}]} $B$r8e$m$K(B
                     63: $BIU$1$k$3$H$K$h$j<h$j=P$9$3$H$,$G$-$k(B. $B$?$@$7(B, $B%7%9%F%`FbIt$G$O(B,
                     64: $B<B:]$K%]%$%s%?$r(B @var{n} $B2s$?$I$k$N$G(B, $B8e$m$NMWAG$[$I<h$j=P$7$K;~4V$,$+$+$k(B.
                     65: @item
                     66: @code{cdr()} $B$O?7$7$$%;%k$r@8@.$7$J$$$,(B, @code{append()} $B$O(B, $B<B:]$K$O(B
                     67: $BBh(B 1 $B0z?t$N%j%9%H$ND9$5$@$1$N(B @code{cons()} $B$N7+$jJV$7$H$J$k$?$a(B,
                     68: $BBh(B 1 $B0z?t$N%j%9%H$,D9$$>l9g$K$OB?$/$N%a%b%j$r>CHq$9$k$3$H$K$J$k(B.
                     69: @code{reverse()} $B$K4X$7$F$bF1MM$G$"$k(B.
                     70: @end itemize
                     71:
                     72: @example
                     73: [0] L = [[1,2,3],4,[5,6]];
                     74: [[1,2,3],4,[5,6]]
                     75: [1] car(L);
                     76: [1,2,3]
                     77: [2] cdr(L);
                     78: [4,[5,6]]
                     79: [3] cons(x*y,L);
                     80: [y*x,[1,2,3],4,[5,6]]
                     81: [4] append([a,b,c],[d]);
                     82: [a,b,c,d]
                     83: [5] reverse([a,b,c,d]);
                     84: [d,c,b,a]
                     85: [6] length(L);
                     86: 3
                     87: [7] L[2][0];
                     88: 5
                     89: @end example
                     90:

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