summaryrefslogtreecommitdiff
path: root/enumerator.c
AgeCommit message (Collapse)Author
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
2008-06-03* enumerator.c (enumerator_allocate, enumerator_ptr): Properlyknu
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
2008-05-26* enumerator.c (struct enumerator, enumerator_init)knu
(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
2008-05-23* enumerator.c (Init_Enumerator): Overrideknu
Enumerable::Enumerator#each_with_index with #with_index. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16558 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-05-13* enumerator.c: Update rdoc.knu
(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
2008-04-22* enumerator.c (enumerator_each, enumerator_with_index): suppressnobu
warnings. * pack.c (pack_unpack): ditto. * process.c (rb_syswait): ditto. * re.c (rb_reg_prepare_enc, rb_reg_prepare_re, rb_reg_adjust_startpos): ditto. * regparse.c (onig_name_to_group_numbers): ditto. * missing/vsnprintf.c (BSD_vfprintf): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-22* enumerator.c (enumerator_initialize): Remove an undocumentedknu
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
2008-04-21* enumerator.c (enumerator_init): preserve the method name in ID.matz
* 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
2008-04-20* enumerator.c, include/ruby/ruby.h: Export rb_cEnumerator.knu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@16107 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-04-20* enumerator.c: Resolve the method every time an enumerationknu
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
2008-03-09fix doc.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15734 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-29* enumerator.c: fix documents.mame
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15326 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-01-08* enum.c (enum_zip): honor length of the receiver, not thematz
shortest length. [ruby-core:14738] * enum.c (enum_zip): returns array not enumerator for no block form. [ruby-core:14738] * enumerator.c (next_ii): do not ignore multiple values yielded. * array.c (rb_ary_zip): faster version without creating generators. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* enumerator.c (enumerator_iter_i): adjusted for rb_block_call_func.nobu
* include/ruby/ruby.h (rb_block_call_func): function to be called back as block. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14416 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* enumerator.c (enumerator_init_copy): typo fixed.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14407 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-21* enumerator.c (enumerator_init_copy): prohibit cloning ofmatz
generators since Fibers cannot be copied. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-20* enumerator.c (enumerator_next): should call next_init() if fibermatz
is dead already. [ruby-dev:32459] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-19* insnhelper.ci (vm_yield_with_cfunc): call cfunc withmatz
(argv[0], data, argc, argv) to pass all arguments. * eval.c (loop_i): adapted to new calling convention. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-01* insns.def (concatarray, splatarray): use to_a instead ofmatz
to_splat. * insnhelper.ci (caller_setup_args): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-12-01* insnhelper.ci (vm_yield_with_cfunc): fix to passing argc on thirdko1
parameter of IFUNC. [ruby-dev:32329] * enumerator.c: fix to pass exact number of argument. * eval.c (rb_yield_values2): added. * include/ruby/ruby.h: ditto. * bootstraptest/test_knownbug.rb: move a fixed test. * bootstraptest/test_block.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14062 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-10-30* enum.c (enum_butfirst): add a new method to iterates overmatz
elements but first n. RDoc need to be updated. * enumerator.c (Init_Enumerator): remove unnecessary symbol initialization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-26* enumerator.c (enumerator_next): message changed.matz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13279 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-25* cont.c: separate Continuation and Fiber from core.ko1
* ext/continuation/*, ext/fiber/*: ditto. * include/ruby/ruby.h: remove rb_cFiber. * include/ruby/intern.h: add the rb_fiber_new() declaration. * enumerator.c (next_init): fix to use rb_fiber_new(). * test/ruby/test_enumerator.rb: remove next? tests. * test/ruby/test_continuation.rb: add a require 'continuation'. * test/ruby/test_fiber.rb: add a require 'fiber'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13259 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-24* enumerator.c (enumerator_next): stop pre-fetching.matz
* enumerator.c (Init_Enumerator): remove next? method. * eval.c (rb_f_loop): now handles StopIteration exception. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-23* enumerator.c (sym_call): initialize first.nobu
* enumerator.c (enum_iter): typedefed. * enumerator.c (next_i): suppress a warning. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-21* cont.c: add Fiber#resume and Fiber.yield.ko1
and Fiber::Core class to realize Coroutine. * include/ruby/intern.h: declare rb_fiber_yield(), rb_fiber_resume(), * enumerator.c: use above api. * test/ruby/test_fiber.rb: fix and add tests for above changes. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13130 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-20* enumerator.c (next_i): fix to return with Fiber#yield atko1
the end of each block. [ruby-dev:31470] * enumerator.c (enumerator_next_p): call init_next if not initialized. [ruby-dev:31514] * test/ruby/test_enumerator.rb: add tests for Enumerator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13120 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-08* enumerator.c (enumerator_next_p): should check correctly even whenmatz
e.next has not been called before. * enumerator.c (enumerator_next): raise StopIteration (name taken from Python) instead of IndexError. * enum.c (enum_zip): catch StopIteration exception. * enumerator.c (enumerator_with_index): return Enumerator if no block is given. * test/ruby/test_iterator.rb (TestIterator::test_enumerator): add test for enumerators. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-06* enum.c (enum_zip): zip no longer converts arguments intomatz
arrays, uses enumerators. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-08-06* cont.c (rb_fiber_yield): change argument ordering. export.matz
* cont.c (rb_fiber_current): export * include/ruby/intern.h: export several functions from cont.c. * enumerator.c (enumerator_next): new method to implement external iterator (generator) using fiber. * enumerator.c (enumerator_next_p): new method to check whether any element is left in the generator sequence. * enumerator.c (enumerator_rewind): a new method to rewind the generator sequence. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12891 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2007-06-10* include/ruby: moved public headers.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@12501 b2dd03c8-39d4-4d8f-98ff-823fe69b080e