summaryrefslogtreecommitdiff
path: root/enumerator.c
AgeCommit message (Collapse)Author
2012-02-20merge revision(s) 34712:marcandre
* enumerator.c (enumerator_rewind): update the documentation. fixed: #6053 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@34713 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-09 * enumerator.c: Remove "enumeration sequenced by".drbrain
[Ruby 1.9 - Bug #4757] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-17* internal.h: declare internal functions here.akr
* node.h: declare NODE dependent internal functions here. * iseq.h: declare rb_iseq_t dependent internal functions here. * vm_core.h: declare rb_thread_t dependent internal functions here. * bignum.c, class.c, compile.c, complex.c, cont.c, dir.c, encoding.c, enumerator.c, error.c, eval.c, file.c, gc.c, hash.c, inits.c, io.c, iseq.c, load.c, marshal.c, math.c, numeric.c, object.c, parse.y, proc.c, process.c, range.c, rational.c, re.c, ruby.c, string.c, thread.c, time.c, transcode.c, variable.c, vm.c, tool/compile_prelude.rb: don't declare internal functions declared in above headers. include above headers if required. Note that rb_thread_mark() was declared as void rb_thread_mark(rb_thread_t *th) in cont.c but defined as void rb_thread_mark(void *ptr) in vm.c. Now it is declared as the later in internal.h. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-01More clarification for enumerator_feedryan
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-31Extra formatting and clarification of enumerator_feed [#4757]ryan
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 * enumerator.c: Improve documentation. Patch by Dave Copeland.drbrain
[Ruby 1.9 - Bug #4757] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-07-18* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]nobu
add parent member. * error.c (rb_typeddata_inherited_p): new function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28676 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29* removed trailing spaces.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17* array.c: Documentation: change => in call-seq to ->.marcandre
Harmonize "#=>" in examples. [ruby-core:30206] * bignum.c: ditto * class.c: ditto * compar.c: ditto * cont.c: ditto * dir.c: ditto * encoding.c: ditto * enum.c: ditto * enumerator.c: ditto * error.c: ditto * eval.c: ditto * file.c: ditto * gc.c: ditto * io.c: ditto * load.c: ditto * marshal.c: ditto * math.c: ditto * numeric.c: ditto * object.c: ditto * pack.c: ditto * proc.c: ditto * process.c: ditto * random.c: ditto * range.c: ditto * re.c: ditto * ruby.c: ditto * signal.c: ditto * sprintf.c: ditto * string.c: ditto * struct.c: ditto * thread.c: ditto * time.c: ditto * transcode.c: ditto * variable.c: ditto * vm_eval.c: ditto * vm_method.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27865 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-08* error.c: RDoc for subclasses of Exception. [ruby-core:28394]marcandre
* cont.c: ditto * enumerator.c: ditto * io.c: ditto * math.c: ditto * numeric.c: ditto * proc.c: ditto * re.c: ditto * thread.c: ditto * transcode.c: ditto. Thanks to Run Paint for some of the documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27671 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-12* enumerator.c (inspect_enumerator): don't raise for uninitializedakr
enumerator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-03* enumerator.c: move implementation of each_slice, each_cons,matz
each_with_object to enum.c. * enum.c (each_slice_i): convert multiple values from yield into an array. * enum.c (each_cons_i): ditto. * enum.c (each_with_object_i): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26546 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-12-20* vm_eval.c (rb_iterate): pass current block when the argument bl_procmame
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
2009-11-11* enumerator.c (yielder_yield_push): Yielder#<< should return self.mame
[ruby-dev:39660] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03fix typos.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-29* array.c (rb_ary_to_ary): do not use #respond_to? to detectmatz
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
2009-09-29* enumerator.c (enumerator_block_call): extracted.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-09* enumerator.c (enumerator_data_type): typed.nobu
(yielder_data_type, generator_data_type): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-27* enumerator.c (next_i): typo fixed (reached at end -> reached anmatz
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
2009-08-22fix rdoc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-22rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-21* enumerator.c (ary2sv): add dup argument.akr
(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
2009-08-21rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-21* enumerator.c (get_next_values): extracted fromakr
enumerator_next_values. (enumerator_next_values): use get_next_values. (enumerator_peek_values): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-19rdoc update.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-19* enumerator.c (next_init): don't clear feedvalue.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-19* enumerator.c: implement Enumerator#{next_values,peek_values,feed}akr
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
2009-08-18* enumerator.c (enumerator_peek): new method Enumerator#peek. akr
(enumerator_next): don't rewind at end. [ruby-dev:38932] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24578 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-18* suppressed shorten-64-to-32 warnings.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-13* enumerator.c (yielder_yield_i): use rb_proc_new instead ofmame
rb_iterate. [ruby-dev:38518] * README.EXT: rb_iterate is obsolete since 1.9; use rb_block_call instead. * README.EXT.ja: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-05-20* enumerator.c (inspect_enumerator): should use long.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23497 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-22Trivial change in comment.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23265 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-03-17* enumerator.c (Enumerator#{each_,}{with_index,with_object}): Fixknu
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
2009-02-09Slightly fix rdoc of with_index.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22170 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-08* enumerator.c (enumerator_with_index): receives one argument whichmame
represents a start offset. [ruby-dev:37921] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@22134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-02-02* enumerator.c: Introduce id_each to save rb_itern() and SYM2ID()knu
calls. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-10* enumerator.c (enumerator_rewind): If the enclosed objectknu
responds to a "rewind" method, call it; cf. [ruby-dev:37268] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-10* enumerator.c (enumerator_next): Fix a typo: s/rewinded/rewound/.knu
* lib/prime.rb (Prime::OldCompatibility#each): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20604 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-04* enumerator.c (inspect_enumerator): Implement #inspect.knu
[ruby-dev:37248]-[ruby-dev:37263] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20481 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-23* common.mk: clean upko1
- remove blockinlining.$(OBJEXT) to built - make ENCODING_H_INCLDUES variable (include/ruby/encoding.h) - make VM_CORE_H_INCLUDES variable (vm_core.h) - simplify rules. - make depends rule to output depend status using gcc -MM. * include/ruby/mvm.h, include/ruby/vm.h: rename mvm.h to vm.h. * include/ruby.h: ditto. * load.c: add inclusion explicitly. * enumerator.c, object.c, parse.y, thread.c, vm_dump.c: remove useless inclusion. * eval_intern.h: cleanup inclusion. * vm_core.h: rb_thread_t should be defined in this file. * vm_evalbody.c, vm_exec.c: rename vm_evalbody.c to vm_exec.c. * vm.h, vm_exec.h: rename vm.h to vm_exec.h. * insnhelper.h, vm_insnhelper.h: rename insnhelper.h to vm_insnhelper.h. * vm.c, vm_insnhelper.c, vm_insnhelper.h: - rename vm_eval() to vm_exec_core(). - rename vm_eval_body() to vm_exec(). - cleanup include order. * vm_method.c: fix comment. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26* enumerator.c: Activate Enumerator#with_object and addknu
Enumerable#each_with_object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18864 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-08-26* enumerator.c (enumerator_initialize),knu
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
2008-08-13* enumerator.c (Init_Enumerator): Rename Enumerable::Enumerator toknu
just Enumerator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18564 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-07-21* enumerator.c (enumerator_with_object): suppress a warning.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-20* enumerator.c (enum_each_cons): typo in RDoc fixed.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17493 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-16* enumerator.c (enumerator_with_object, Init_Enumerator):knu
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
2008-06-08* array.c, bignum.c, cont.c, dir.c, dln.c, encoding.c, enumerator.c,ko1
enumerator.c (enumerator_allocate), eval_jump.c, file.c, hash.c, io.c, load.c, pack.c, proc.c, random.c, re.c, ruby.c, st.c, string.c, thread.c, thread_pthread.c, time.c, util.c, variable.c, vm.c, gc.c: allocated memory objects by xmalloc (ruby_xmalloc) should be freed by xfree (ruby_xfree). * ext/curses/curses.c, ext/dbm/dbm.c, ext/digest/digest.c, ext/gdbm/gdbm.c, ext/json/ext/parser/parser.c, ext/json/ext/parser/unicode.c, ext/openssl/ossl_cipher.c, ext/openssl/ossl_hmac.c, ext/openssl/ossl_pkey_ec.c, ext/sdbm/init.c, ext/strscan/strscan.c, ext/zlib/zlib.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@17017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-04* enumerator.c (enumerator_with_index, enumerator_with_memo): Fixknu
grammo in rdoc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16802 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-03* enumerator.c (enumerator_with_memo): New method: with_memo().knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-06-03* enumerator.c (enumerator_init_copy): Take care ofknu
initialize_copy as well as initialize. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e