diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-05-30 06:12:29 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-05-30 06:12:29 +0000 |
commit | 0390fc54a4924aa219eaec2be981ef05acd60be7 (patch) | |
tree | 3bedb874808188b29de760c9dcc1baa80542b85e /time.c | |
parent | 76cae3b05f8fd67cb98416fa210e137d0c223ea1 (diff) | |
download | ruby-0390fc54a4924aa219eaec2be981ef05acd60be7.tar.gz ruby-0390fc54a4924aa219eaec2be981ef05acd60be7.tar.xz ruby-0390fc54a4924aa219eaec2be981ef05acd60be7.zip |
* range.c (range_step): iteration done using "+" if elements are
Numeric. Otherwise using "succ".
* range.c (range_each): iteration done using "succ". If the
elements does not respond to "succ", raise TypeError. As a
result, all Enumerable methods, e.g. collect, require elements
to respond to "succ'.
* range.c (range_member): comparison done using "each", if
elements are non-Numeric or no-"succ" objects. Otherwise
compare using "<=>".
* range.c (Init_Range): remove "size" and "length".
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'time.c')
-rw-r--r-- | time.c | 12 |
1 files changed, 0 insertions, 12 deletions
@@ -691,16 +691,6 @@ time_usec(time) } static VALUE -time_succ(time) - VALUE time; -{ - struct time_object *tobj; - - GetTimeval(time, tobj); - return rb_time_new(tobj->tv.tv_sec + 1, tobj->tv.tv_usec); -} - -static VALUE time_cmp(time1, time2) VALUE time1, time2; { @@ -1449,8 +1439,6 @@ Init_Time() rb_define_method(rb_cTime, "hash", time_hash, 0); rb_define_method(rb_cTime, "clone", time_clone, 0); rb_define_method(rb_cTime, "dup", time_dup, 0); - rb_define_method(rb_cTime, "succ", time_succ, 0); - rb_define_method(rb_cTime, "next", time_succ, 0); rb_define_method(rb_cTime, "localtime", time_localtime, 0); rb_define_method(rb_cTime, "gmtime", time_gmtime, 0); |