1.9 e$B$He(B 1.8 e$B$NN>J}$Ge(B ?a.ord e$B$Ge(B 97
e$B$,F@$i$l$k$h$&$K!"e(B1.8 e$B$Ke(B
Integer#ord e$B$r2C$($k$N$O$I$&$G$7$g$&$+!#e(B
Index: numeric.c
— numeric.c (e$B%j%S%8%g%se(B 13873)
+++ numeric.c (e$B:n6H%3%T!<e(B)
@@ -1807,6 +1807,27 @@
return rb_str_new(&c, 1);
}
+/*
-
-
-
-
-
-
-
-
-
-
- This method is intended for compatibility to
-
- character constant in Ruby 1.9.
- */
-
+static VALUE
+int_ord(num)
- VALUE num;
+{
- return num;
+}
-
/********************************************************************
*
- Document-class: Fixnum
@@ -2924,6 +2945,7 @@
rb_define_method(rb_cInteger, “succ”, int_succ, 0);
rb_define_method(rb_cInteger, “next”, int_succ, 0);
rb_define_method(rb_cInteger, “chr”, int_chr, 0);
- rb_define_method(rb_cInteger, “ord”, int_ord, 0);
rb_define_method(rb_cInteger, “to_i”, int_to_i, 0);
rb_define_method(rb_cInteger, “to_int”, int_to_i, 0);
rb_define_method(rb_cInteger, “floor”, int_to_i, 0);
At Sun, 11 Nov 2007 06:20:09 +0900,
Tanaka A. wrote:
1.9 㨠1.8 ã®ä¸¡æ–¹ã§ ?a.ord ã§ 97 ãŒå¾—られるよã†ã«ã€1.8 ã«
Integer#ord ã‚’åŠ ãˆã‚‹ã®ã¯ã©ã†ã§ã—ょã†ã‹ã€‚
"
String#ord ã‚’è¿½åŠ ã—ã¦ã©ã¡ã‚‰ã§ã‚‚ ‘a’.ord ã¨ã„ã†ã®ã§ã¯ã„ã¾ã„ã¡
ã§ã™ã‹ã。?a.ord ã¨æ›¸ããŸã„æ°—æŒã¡ã®æ–¹ãŒå¼·ã„ã‹ãªã€‚
–
/
/__ __ Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp
“Different eyes see different things,
Different hearts beat on different strings –
But there are times for you and me when all such things agree”
At Mon, 12 Nov 2007 23:37:44 +0900,
Tanaka A. wrote:
In article [email protected],
“Akinori MUSHA” [email protected] writes:
String#ord ã‚’è¿½åŠ ã—ã¦ã©ã¡ã‚‰ã§ã‚‚ ‘a’.ord ã¨ã„ã†ã®ã§ã¯ã„ã¾ã„ã¡
ã§ã™ã‹ã。?a.ord ã¨æ›¸ããŸã„æ°—æŒã¡ã®æ–¹ãŒå¼·ã„ã‹ãªã€‚
?a.ord ã®ã‚ˆã†ã« ?a ãŒæ›¸ã„ã¦ã‚ã‚‹ã¨ã“ã‚ã‚’æ›¸ãæ›ãˆã‚‰ã‚Œã‚‹ã®ã§ã‚
れã°ã„ã„ã®ã§ã™ãŒã€ãƒ©ã‚¤ãƒ–ラリã®å‘¼å‡ºå…ƒã« ?a ã¨æ›¸ã„ã¦ã‚ã£ã¦ã€ãƒ©
イブラリå´ã§ãれをサãƒãƒ¼ãƒˆã—ãŸã„ã¨ã„ã†ã‚±ãƒ¼ã‚¹ã§ã¯ã†ã¾ãã„ãã¾
ã›ã‚“。
 ãªã‚‹ã»ã©ã€‚äº’æ›æ€§ã®ãŸã‚ã ã‘ã¨ã„ã†ã¨ã“ã‚ãŒå°‘ã—引ã£ã‹ã‹ã£ãŸã‚“
ã§ã™ãŒã€å°‘ãªãã¨ã‚‚自然数ãªã‚‰æ„味ã¯é€šã‚‹(ordinal:åºæ•°)ã®ã§ç´å¾—
ã—ã¾ã—ãŸã€‚
–
/
/__ __ Akinori.org / MUSHA.org
/ ) ) ) ) / FreeBSD.org / Ruby-lang.org
Akinori MUSHA aka / (_ / ( (__( @ iDaemons.org / and.or.jp
“Different eyes see different things,
Different hearts beat on different strings –
But there are times for you and me when all such things agree”
In article [email protected],
“Akinori MUSHA” [email protected] writes:
String#ord e$B$rDI2C$7$F$I$A$i$G$be(B ‘a’.ord e$B$H$$$&$N$G$O$$$^$$$Ae(B
e$B$G$9$+$M!#e(B?a.ord e$B$H=q$-$?$$5$;}$A$NJ}$,6/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