Age | Commit message (Collapse) | Author |
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@26215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* array.c, bignum.c, dir.c, enumerator.c, gc.c, io.c, numeric.c,
object.c, re.c, string.c, struct.c: Mixing two styles is not a
good thing. Stick with the K&R style in 1.8.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@23052 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
calls.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@21977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
prototypes to suppress warnings due to a bug of VC6.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@21716 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
[ruby-dev:37248]-[ruby-dev:37263]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20851 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
lib/generator.rb (Enumerator#rewind): If the enclosed object
responds to a "rewind" method, call it.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20645 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
an enumerator from a block. [ruby-dev:35903]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20631 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Enumerable#each_with_object and Enumerator#with_object.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* lib/generator.rb (Enumerator#next): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@20605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Enumerable::Enumerator is renamed to Enumerator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18749 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
just Enumerator and redefine the former as an alias for backward
compatibility.
* lib/set.rb (TC_Set#test_each),
test/ruby/test_enumerator.rb (TestEnumerator#test_initialize):
Enumerable::Enumerator is now called Enumerator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18705 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Enumerable::Enumerator for forward compatibility.
* lib/rinda/tuplespace.rb (Rinda::TupleBag#initialize): Use
enum_for instead of hardcoding Enumerable::Enumerator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@18602 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
initialize_copy as well as initialize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16791 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/branches/ruby_1_8@16768 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
and String#slice!(). Just return nil when a negative length or
out of boundary index is given instead of raising an exception
via internal functions.
(rb_ary_slice_bang): should not use rb_ary_subseq() which shares
internal pointer. splice modifies the receiver right after
subseq. [ruby-dev:34005]
(rb_ary_slice_bang): should adjust length before making
sub-array.
* enumerator.c (Init_Enumerator): Override
Enumerable::Enumerator#each_with_index with #with_index.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16557 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
performance.
(rb_ary_nitems): Undo the backport. Use #count {} instead.
* enumerator.c (enumerator_iter_i): Remove an unused function.
(enumerator_with_index, enumerator_each): Remove unused
variables.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16417 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.
* NEWS: Intentionally omit enum_slice and enum_cons, which are
removed in 1.9.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16403 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/branches/ruby_1_8@16147 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/branches/ruby_1_8@16126 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/branches/ruby_1_8@16108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
* enumerator.c (enumerator_iter_i, enumerator_each_i): Ditto.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16005 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
enumerator_allocate): add prototype.
* enumerator.c (enumerator_each_i): declare unused two arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@16002 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
Add a new exception class StopIteration, which breaks Kernel#loop
iteration when raised; backported from 1.9.
* enumerator.c (enumerator_next, enumerator_rewind): Implement
#next and #rewind using the "generator" library.
* lib/generator.rb: Implement Enumerable::Enumerator#next and
#rewind.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|
|
ext/enumerator, common.mk (OBJS, enumerator.$(OBJEXT)): Make the
enumerator module built-in,
* enumerator.c: New method: Enumerable::Enumerator#with_index.
* enum.c (enum_each_with_index): Enumerable#each_with_index now
returns an enumerator instead of raising an exception if no
block is given. Enumerable#enum_with_index, formerly defined in
the enumerator module, is kept as an alias to each_with_index
for backward compatibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@15934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
|