is NULL. This behavior can be used to make enumerator faster
[ruby-dev:39874]
* enumerator.c (enumerator_each): pass current block directly instead
of trampoline block (enumerator_each_i).
* io.c (argf_each_line, argf_each_byte, argf_each_char): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
to_ary. Just call. [ruby-core:23738]
* eval.c (rb_check_funcall): new function with method existence
check. returns Qundef when the method does not exist.
* enumerator.c (enumerator_rewind): just call method, using
rb_check_funcall(). [ruby-core:23738]
* error.c (exc_equal): ditto.
* object.c (convert_type): ditto.
* error.c (rb_name_err_mesg_new): export function.
* eval.c (make_exception): ditto.
* io.c (pop_last_hash): return early when the last argument is nil.
* io.c (rb_io_puts): treat T_STRING specially for small
optimization.
* vm_eval.c (raise_method_missing): skip method call if possible
using rb_method_basic_definition_p().
* vm_eval.c (method_missing): ditto.
* test/ruby/test_rubyoptions.rb (TestRubyOptions#test_debug): test
suites changed to ignore exceptions caused by just-call policy.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
end). pointed out by James Edward Gray II at LoneStar RubyConf.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24685 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(enumerator_next): call ary2sv with dup=0.
(enumerator_peek): call ary2sv with dup=1 to return duplicated array.
(enumerator_peek_values_m): new function to return duplicated array.
(Init_Enumerator): use enumerator_peek_values_m as
Enumerator#peek_value.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24619 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
and StopIteration#result. [ruby-dev:39109]
(struct enumerator): replace no_next by stop_exc.
new field feedvalue.
(enumerator_mark): mark feedvalue and stop_exc.
(enumerator_init): initialize feedvalue and stop_exc.
(enumerator_init_copy): initialize feedvalue.
(next_ii): send yield arguments as an array. return feedvalue.
(next_i): generate StopIteration exception here. set result.
(next_init): initialize feedvalue.
(enumerator_next_values): new method Enumerator#next_values.
(ary2sv): new function.
(enumerator_peek_values): new method Enumerator#peek_values.
(enumerator_feed): new method Enumerator#feed.
(yielder_yield): return the yield value.
(generator_each): return the iterator value.
(stop_result): new method StopIteration#result.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24587 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
a bug where any parameter but the first one is dropped even if
multiple values are yielded with. [Bug #1198]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22992 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
test/ruby/test_enumerator.rb: Add an ability to generate an
enumerator from a block. [experimental] [ruby-dev:35903]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18863 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Temporarily back out with_memo, for which we need a better name.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
detect if the object is initialized and raise error when
appropriate.
(enumerator_initialize): Fix a typo in rdoc. [ruby-core:17052]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16767 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(enumerator_init_copy, enumerator_each): Eliminate iter.
(enumerator_ptr): Do not hardcode the class name.
(enumerator_with_index): Delay variable initialization after
RETURN_ENUMERATOR().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16614 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
(enumerator_initialize): Discourage the use.
(enum_each_slice, enum_each_cons, enumerator_each)
(enumerator_with_index): Add a note about a call without a block.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16402 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
feature (passing a block to the constructor) that's broken.
This is not what I intended.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16146 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enumerator.c (enumerator_each): need not to call rb_to_id().
* enumerator.c (enumerator_with_index): ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16121 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
method is run, not once when the enumerator is initialized as it
was before, so that method_missing() and method (re)definition
afterwards are both in effect; pointed out in: [ruby-core:16441]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16106 b2dd03c8-39d4-4d8f-98ff-823fe69b080e