e$B$J$+$@$G$9!#e(B
At Sun, 3 Feb 2008 11:10:45 +0900,
Tadayoshi F. wrote in [ruby-dev:33573]:
e$B$3$N$"$?$j$O!“e(Bruby e$B$G=q$$$F$”$k$N$G$9$,!"$=$3$r8+$F$J$$$N$@$H;W$$$^$9!#e(B
e$B$J$+$@$5$s$O!"%=!<%9$rD/$a$F$k$@$1$G!"F0$+$7$F$O$$$J$$$H;W$&$N$G$9$,!#e(B
e$B$?$7$+$K!#e(Blib/prelude.rbe$B$G$7$?$+!#e(B
e$B$A$g$C$H8+$?$H$3$m!"e(BEnumerable#stable_sort_bye$B$,e(Bsorte$B$r;H$C$F$$$ke(B
e$B$N$G0BDj$G$J$$$h$&$G$9!#e(B
$ ./nuby -e ‘a=[];%w[def abc def abc].each_with_index{|*e|a<<e}; p
a.stable_sort{|e,f|e[0]<=>f[0]}’
[[“abc”, 1], [“abc”, 3], [“def”, 0], [“def”, 2]]
$ ./nuby -e ‘a=[];%w[def abc def abc].each_with_index{|*e|a<<e}; p
a.stable_sort_by{|e,i|e}’
[[“abc”, 3], [“abc”, 1], [“def”, 2], [“def”, 0]]
x.quotient(y) e$B$Oe(B x.quo(y).floor e$B$H@:EY$r=|$$$F$OEy2A$G$9$+!#e(B
e$B$$$(!#e(Bquotient (quot) e$B$O!"e(BScheme (r5rs e$B$^$Ge(B) e$B$N$=$l$d!"e(BCommon Lisp e$B$Ne(B
truncate e$B$N$R$H$DL$NCM!"e(BSmalltalk e$B$Ne(B quo e$B$HF1MM$H9M$($^$9!#$J$N$Ge(B
truncate e$B$N$[$&$G$9$+$M!#e(B
e$B$J$k$[$I!"Ii$NCM$G0c$$$^$9$M!#e(B
e$B$$$d!"$=$3$^$G:o$C$A$c$&$N$O$I$&$+$H;W$$$^$9$,!#e(B
e$B$s!<!"$=$&$G$9$+!#e(BNumeric#floor e$BI,MW$G$9$+!#e(BInteger e$B$K$OMW$i$J$$$7!“e(B
Rational e$B$de(B Complex e$B$K$bE,$5$J$$$H;W$&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