summaryrefslogtreecommitdiff
path: root/enumerator.c
AgeCommit message (Collapse)Author
2012-11-07* include/ruby/intern.h: Restore rb_enumeratorize as it was before r37497marcandre
and introduce rb_enumeratorize_with_size instead. [#7302] * enumerator.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06enum.c: prefixnobu
* enum.c (rb_enum_cycle_size): prefix with rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37531 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06adjust stylenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Support for lazy.cycle.sizemarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Add support for lazy.drop.sizemarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Support for lazy.take.sizemarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Support for lazy.{map|flat_map|...}.sizemarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Support for lazy.sizemarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c: Support #size for enumerators created from enumeratorsmarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c (obj_to_enum): Have #to_enum accept a blockmarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator: New method #size; constructor accepts sizemarcandre
[Feature #6636] * include/ruby/intern.h: RETURN_SIZED_ENUMERATOR for support of sized enumerators git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06* enumerator.c (enumerator_initialize): Warn when using deprecated formmarcandre
[Feature #6636] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-06-05obj_init_copynobu
* object.c (rb_obj_init_copy): should check if trusted too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23use RB_TYPE_P() instead of comparison of TYPE()nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-13* enumerator.c (lazy_take_func, lazy_take): multiple calls ofnagachika
force/to_a method to Enumerator::Lazy#take should return same results. [ruby-dev:45634] [Bug #6428] * test/ruby/test_lazy_enumerator.rb (test_take_recycle): add test for above. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03initialize IDs in advance.nobu
* enumerator.c (Init_Enumerator): initialize IDs in advance. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35219 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-03* enumerator.c (inspect_enumerator): suppress uninitializednobu
instance variable warnings. [ruby-dev:45449][Bug #6214] patched by no6v (Nobuhiro IMAI). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35218 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-26* enumerator.c (inspect_enumerator): show method arguments ofshugo
lazy enumerators correctly. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-24* enumerator (lazy_initialize): set the instance variable "receiver"shugo
to include the receiver to the return value of inspect on a lazy enumerator directly created by Enumerator::Lazy.new. * enumerator (RETURN_LAZY): don't set the instance variable "receiver". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-24* enumerator (enumerator_inspect): include the original receiver andshugo
method name of Enumerator::Lazy in the result of inspect. [ruby-core:43345] [Bug #6159] * enumerator (InitVM_Enumerator): don't use rb_define_alias for some methods such as collect in order to make rb_frame_this_func() return the correct method names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35124 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-19* enumerator.c (lazy_flat_map_func): convert the block value toshugo
Array if it doesn't respond to each. [ruby-core:43334] [Bug #6155] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-19* enumerator.c (enumerable_lazy): add an example of take and firstshugo
to the documentation. [ruby-core:43344] [Bug #6158] add the description of the behavior when a block is given to zip or cycle. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16follow r35040kazu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16* enumerator.c (lazy_take): don't enumerate an extra value.shugo
[ruby-dev:45370] [Bug #6152] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enumerator.c (lazy_zip_func): variadic argument needs explicit castnobu
on the platforms where VALUE is longer than int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enumerator.c (lazy_init_iterator): no need to check overflow twice.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 * enumerator.c (lazy_init_iterator): Fix type error (int vs long).drbrain
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enum.c (rb_enum_values_pack): rename from enum_values_pack, andshugo
remove static. * enumerator.c (lazy_init_iterator, lazy_init_yielder, lazy_select_func, lazy_reject_func, lazy_grep_func): handle multiple values correctly. * enumerator.c (lazy_grep): change the behavior when a block is given, to be consistent with Enumerable#grep. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enumerator.c (lazy_zip): rescue StopIteration returned byshugo
Enumerator#next. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enumerator.c (lazy_zip, lazy_cycle): Enumerator::Lazy#{zip,cycle}shugo
should be eager when a block is given, to be consistent with Enumerable#{zip,cycle}. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enumerator.c (InitVM_Enumerator): renamed Enumerable::Lazy toshugo
Enumerator::Lazy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enumerator.c (enumerator_lazy): added cycle to the documentation.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enumerator.c (lazy_cycle): check argument number overflow beforenobu
creating temporary array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15* enumerator.c (lazy_cycle): add Enumerable::Lazy#cycle.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre
* array.c: Use rb_check_arity / rb_error_arity * class.c: ditto * enumerator.c: ditto * eval.c: ditto * file.c: ditto * hash.c: ditto * numeric.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * re.c: ditto * signal.c: ditto * string.c: ditto * struct.c: ditto * transcode.c: ditto * vm_eval.c: ditto * vm_insnhelper.c: ditto & implementation of rb_error_arity * test/ruby/test_arity.rb: tests for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35024 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* enumerator.c (enumerable_lazy): fix the documentation ofshugo
Enumerable#lazy. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* enumerator.c (lazy_init_iterator): break when Qundef is returnedshugo
to make obj.drop(3).take(2) work properly. * enumerator.c (lazy_take_while): add Enumerable::Lazy#take_while. * enumerator.c (lazy_drop): add Enumerable::Lazy#drop. * enumerator.c (lazy_drop_while): add Enumerable::Lazy#drop_while. * enumerator.c (InitVM_Enumerator): add Enumerable::Lazy#force as an alias of to_a. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35019 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* enumerator.c (lazy_take): add Enumerable::Lazy#take.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* enumerator.c: use long for array indices.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* enumerator.c: moved the comment of StopIteration.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14* enumerator.c (lazy_grep_func): should use === instead of =~, asnobu
well as Enumerable#grep git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14InitVM_Enumeratornobu
* enumerator.c (InitVM_Enumerator): split from Init_Enumerator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14Init_Enumeratornobu
* enumerator.c (Init_Enumerator): initialize method IDs first. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35006 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13* enumerator.c (lazy_zip_func): use each for non-Array objects.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13* enumerator.c (lazy_zip): add Enumerable::Lazy#flat_map.shugo
* enumerator.c (lazy_lazy): just returns self. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12* enumerator.c (enumerable_lazy): added the documenation of Enumerable#lazy.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-10* enumerator.c: remove trailing space.ktsj
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-09* enumerator.c (lazy_flat_map): add Enumerable::Lazy#flat_map.shugo
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-08* enumerator.c (lazy_initialize, enumerable_lazy): no additionalnobu
arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-08* enumerator.c: add Enumerable#lazy. based on the patch bynobu
Innokenty Mikhailov at <https://github.com/ruby/ruby/pull/101> [ruby-core:37164] [Feature #4890] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e