diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-30 14:49:51 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-08-30 14:49:51 +0000 |
commit | 74433fd300ff90e61086681fd1152d2da0d28171 (patch) | |
tree | 34fedf9739363293313b40fa4509e7f87ef93880 /range.c | |
parent | 87e8b14cc403f13d5c0d3cbd715a2d85c52fcb95 (diff) | |
download | bundler-74433fd300ff90e61086681fd1152d2da0d28171.tar.gz |
* array.c, dir.c, enum.c, hash.c, io.c, range.c, string.c, struct.c:
let enumerable methods return Enumerator. [ruby-dev:26924]
* intern.h (RETURN_ENUMERATOR): utility macro for enumerable methods.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@9053 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'range.c')
-rw-r--r-- | range.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -303,6 +303,8 @@ range_step(argc, argv, range) VALUE b, e, step; long unit; + RETURN_ENUMERATOR(range, argc, argv); + b = rb_ivar_get(range, id_beg); e = rb_ivar_get(range, id_end); if (rb_scan_args(argc, argv, "01", &step) == 0) { @@ -392,6 +394,8 @@ range_each(range) { VALUE beg, end; + RETURN_ENUMERATOR(range, 0, 0); + beg = rb_ivar_get(range, id_beg); end = rb_ivar_get(range, id_end); |