diff options
author | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-19 15:18:50 +0000 |
---|---|---|
committer | mame <mame@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-04-19 15:18:50 +0000 |
commit | 7f95eed19e22cb9a4867819355fe4ab99f85fd16 (patch) | |
tree | 988295914fd4e93cf415ec614a9f0a9923e71299 /internal.h | |
parent | 3a5d1e4b775deee8c8731a97048b752a33b35922 (diff) | |
download | ruby-7f95eed19e22cb9a4867819355fe4ab99f85fd16.tar.gz |
Introduce endless range [Feature#12912]
Typical usages:
```
p ary[1..] # drop the first element; identical to ary[1..-1]
(1..).each {|n|...} # iterate forever from 1; identical to 1.step{...}
```
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63192 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal.h b/internal.h index cc5f4b7e99..ae5fef437a 100644 --- a/internal.h +++ b/internal.h @@ -1404,7 +1404,7 @@ enum ruby_num_rounding_mode { int rb_num_to_uint(VALUE val, unsigned int *ret); VALUE ruby_num_interval_step_size(VALUE from, VALUE to, VALUE step, int excl); -int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl); +int ruby_float_step(VALUE from, VALUE to, VALUE step, int excl, int allow_endless); double ruby_float_mod(double x, double y); int rb_num_negative_p(VALUE); VALUE rb_int_succ(VALUE num); @@ -2013,6 +2013,7 @@ VALUE rb_gcd_gmp(VALUE x, VALUE y); /* internal use */ VALUE rb_setup_fake_str(struct RString *fake_str, const char *name, long len, rb_encoding *enc); #endif +VALUE rb_str_upto_endless_each(VALUE, VALUE (*each)(), VALUE); /* thread.c (export) */ int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */ |