nobu
4a429c11e1
enumerator.c: allow Bignum for with_index
...
* enumerator.c (enumerator_with_index_i): allow Bignum as offset, to
get rid of conversion exception and integer overflow.
[ruby-dev:47131] [Bug #8010 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-05 01:20:20 +00:00
marcandre
673e1b9276
* enumerator.c: rdoc fix
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39438 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-23 17:38:12 +00:00
nobu
4b81b403eb
enumerator.c: suppress warnings
...
* enumerator.c (lazy_zip_arrays_func, lazy_zip_func, lazy_take_func),
(lazy_drop_func, lazy_drop_while_func): suppress uninitialized
instance vriable warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39329 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-20 03:15:32 +00:00
marcandre
757bbe8737
* enumerator.c: Remove rdoc that is obsolete because of lazy
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05 05:52:39 +00:00
marcandre
1677cbce9d
* enumerator.c: Use to_enum for Enumerable methods returning Enumerators.
...
This makes Lazy#cycle no longer needed, so it was removed.
Make Enumerator#chunk and slice_before return lazy Enumerators.
[Bug #7715 ]
* internal.h: Remove ref to rb_enum_cycle_size; no longer needed
* enum.c: Make enum_cycle_size static.
* test/ruby/test_lazy_enumerator.rb: Test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05 03:49:59 +00:00
marcandre
44cd5f21e9
* enumerator.c: Finalize and document Lazy.new. [Bug #7248 ]
...
Add Lazy#to_enum and simplify Lazy#size.
* test/ruby/test_lazy_enumerator.rb: tests for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39057 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05 03:49:41 +00:00
marcandre
5af821c6e9
* enumerator.c: Fix and improve rdoc for to_enum
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39056 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-02-05 03:49:22 +00:00
marcandre
aab2f788d7
* enumerator.c (lazy_zip): raise error for bad arguments
...
[Bug #7706 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24 07:50:33 +00:00
marcandre
1af390b1ea
* enumerator.c: Optimize Lazy#zip when passed only arrays
...
[Bug #7706 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24 07:05:42 +00:00
marcandre
41d6ba8765
* enumerator.c: Fix state handling for Lazy#zip
...
[bug #7696 ] [bug #7691 ]
* test/ruby/test_lazy_enumerator.rb: test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38923 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24 06:24:22 +00:00
marcandre
9d94a1a5a1
* enumerator.c: Fix state handling for Lazy#drop
...
[bug #7696 ] [bug #7691 ]
* test/ruby/test_lazy_enumerator.rb: test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38922 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24 06:23:42 +00:00
marcandre
bcbeb5d008
* enumerator.c: Fix state handling for Lazy#drop_while
...
[bug #7696 ] [bug #7691 ]
* test/ruby/test_lazy_enumerator.rb: test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38921 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24 06:23:07 +00:00
marcandre
de0e887635
* enumerator.c: Fix state handling for Lazy#take
...
[bug #7696 ]
* test/ruby/test_lazy_enumerator.rb: test for above
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38920 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-24 06:22:34 +00:00
shugo
7dd52f895f
* enumerator.c (lazy_flat_map_func): flat_map should call each only
...
when the value of a block returns a forcable object.
[ruby-core:51401] [Bug #7690 ]
* enumerator.c (lazy_flat_map): add documentation.
* test/ruby/test_lazy_enumerator.rb: related test.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-14 08:36:15 +00:00
marcandre
8ca504214d
* enumerator.c: Require block for Lazy#{take|drop}_while [Bug #7692 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38811 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-14 07:42:43 +00:00
marcandre
62e67609b6
* enumerator.c: Fix size for Enumerator::Lazy#flat_map
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38808 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-14 01:19:12 +00:00
marcandre
19c530d8c1
* enumerator.c: Fix rdoc typo (thanks to Yutaka HARA)
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38793 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-13 00:19:10 +00:00
nobu
e878df745c
use RB_TYPE_P
...
* enumerator.c (enumerator_initialize), eval.c (rb_using_refinement),
(add_activated_refinement), numeric.c (num_interval_step_size),
parse.y (arg, match_op_gen, cond0), range.c (range_bsearch),
vm_insnhelper.c (vm_get_iclass): use RB_TYPE_P() to optimize.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38653 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-29 12:22:01 +00:00
nobu
66fd9d44d8
adjust style.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38128 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-01 15:25:28 +00:00
marcandre
a68cc24a9e
* include/ruby/intern.h: Restore rb_enumeratorize as it was before r37497
...
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-07 19:46:16 +00:00
nobu
db54dc7215
enum.c: prefix
...
* 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-06 22:52:52 +00:00
nobu
7f00f853d4
adjust style
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37530 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 22:50:30 +00:00
marcandre
0814c4ac64
* enumerator.c: Support for lazy.cycle.size
...
[Feature #6636 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37525 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:16:58 +00:00
marcandre
7a31096255
* enumerator.c: Add support for lazy.drop.size
...
[Feature #6636 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37524 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:16:44 +00:00
marcandre
9aafa954aa
* enumerator.c: Support for lazy.take.size
...
[Feature #6636 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37523 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:16:29 +00:00
marcandre
5dbbfc3b34
* enumerator.c: Support for lazy.{map|flat_map|...}.size
...
[Feature #6636 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37522 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:16:13 +00:00
marcandre
c8426ce840
* enumerator.c: Support for lazy.size
...
[Feature #6636 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37521 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:15:59 +00:00
marcandre
57d596cdb4
* enumerator.c: Support #size for enumerators created from enumerators
...
[Feature #6636 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37499 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:10:35 +00:00
marcandre
acfd34a6a9
* enumerator.c (obj_to_enum): Have #to_enum accept a block
...
[Feature #6636 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37498 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:10:20 +00:00
marcandre
610eeffa46
* enumerator: New method #size; constructor accepts size
...
[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 17:10:06 +00:00
marcandre
c73b6bd7eb
* enumerator.c (enumerator_initialize): Warn when using deprecated form
...
[Feature #6636 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37495 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-11-06 17:09:43 +00:00
nobu
2073258a7d
obj_init_copy
...
* 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-06-05 11:13:18 +00:00
nobu
b0dd250dc9
use RB_TYPE_P() instead of comparison of TYPE()
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35763 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-05-23 07:13:21 +00:00
nagachika
4007da1792
* enumerator.c (lazy_take_func, lazy_take): multiple calls of
...
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-05-13 15:24:40 +00:00
nobu
b30aa26707
initialize IDs in advance.
...
* 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 01:24:51 +00:00
nobu
63e8110bfc
* enumerator.c (inspect_enumerator): suppress uninitialized
...
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-04-03 01:18:31 +00:00
shugo
b9f67c4149
* enumerator.c (inspect_enumerator): show method arguments of
...
lazy enumerators correctly.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35136 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-26 10:52:02 +00:00
shugo
0c9f66eb40
* enumerator (lazy_initialize): set the instance variable "receiver"
...
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 15:53:38 +00:00
shugo
6b885f6e74
* enumerator (enumerator_inspect): include the original receiver and
...
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-24 15:17:31 +00:00
shugo
ded27bf5dc
* enumerator.c (lazy_flat_map_func): convert the block value to
...
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 08:22:29 +00:00
shugo
831898bd99
* enumerator.c (enumerable_lazy): add an example of take and first
...
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-19 06:41:02 +00:00
kazu
30c0db4a85
follow r35040
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 22:05:31 +00:00
shugo
29f73009ca
* enumerator.c (lazy_take): don't enumerate an extra value.
...
[ruby-dev:45370] [Bug #6152 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35050 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-16 02:22:20 +00:00
nobu
a1f4163dd3
* enumerator.c (lazy_zip_func): variadic argument needs explicit cast
...
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 21:30:12 +00:00
nobu
641e9e7bce
* enumerator.c (lazy_init_iterator): no need to check overflow twice.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 21:29:32 +00:00
drbrain
5e72676688
* enumerator.c (lazy_init_iterator): Fix type error (int vs long).
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 20:53:23 +00:00
shugo
2baeb78294
* enum.c (rb_enum_values_pack): rename from enum_values_pack, and
...
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 14:20:27 +00:00
shugo
d135138f9b
* enumerator.c (lazy_zip): rescue StopIteration returned by
...
Enumerator#next.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35042 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 10:14:22 +00:00
shugo
032861ade7
* enumerator.c (lazy_zip, lazy_cycle): Enumerator::Lazy#{zip,cycle}
...
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 09:25:03 +00:00
shugo
ff1f6107f9
* enumerator.c (InitVM_Enumerator): renamed Enumerable::Lazy to
...
Enumerator::Lazy.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35040 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 08:47:09 +00:00
shugo
4a1db362f0
* enumerator.c (enumerator_lazy): added cycle to the documentation.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35039 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 07:38:11 +00:00
nobu
fbdce66908
* enumerator.c (lazy_cycle): check argument number overflow before
...
creating temporary array.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35036 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 06:19:42 +00:00
shugo
d18dc74698
* enumerator.c (lazy_cycle): add Enumerable::Lazy#cycle.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35028 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-15 02:00:30 +00:00
marcandre
7316302483
* include/ruby/intern.h: Add rb_check_arity, rb_error_arity [ #6085 ]
...
* 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 21:10:34 +00:00
shugo
552adf8c5b
* enumerator.c (enumerable_lazy): fix the documentation of
...
Enumerable#lazy.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35021 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 16:00:30 +00:00
shugo
c8860b504e
* enumerator.c (lazy_init_iterator): break when Qundef is returned
...
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 13:04:18 +00:00
shugo
0b35e9e5dd
* enumerator.c (lazy_take): add Enumerable::Lazy#take.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35018 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 10:29:25 +00:00
shugo
0d94434eca
* enumerator.c: use long for array indices.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 09:41:44 +00:00
shugo
449c8a2ba3
* enumerator.c: moved the comment of StopIteration.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35016 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 09:26:27 +00:00
nobu
cb1d290886
* enumerator.c (lazy_grep_func): should use === instead of =~, as
...
well as Enumerable#grep
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-14 01:44:37 +00:00
nobu
8f30190dfe
InitVM_Enumerator
...
* 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-14 01:35:12 +00:00
nobu
8cdfe403d3
Init_Enumerator
...
* 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-14 01:35:09 +00:00
shugo
6b4525912b
* enumerator.c (lazy_zip_func): use each for non-Array objects.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35004 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-13 23:16:37 +00:00
shugo
22434473c7
* enumerator.c (lazy_zip): add Enumerable::Lazy#flat_map.
...
* 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-13 23:08:15 +00:00
shugo
f0f777bc4a
* enumerator.c (enumerable_lazy): added the documenation of Enumerable#lazy.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-12 15:12:07 +00:00
ktsj
0934e6c014
* enumerator.c: remove trailing space.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34961 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-10 13:33:16 +00:00
shugo
a21d0f72c2
* enumerator.c (lazy_flat_map): add Enumerable::Lazy#flat_map.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34956 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-09 05:34:41 +00:00
nobu
e7d4e659a0
* enumerator.c (lazy_initialize, enumerable_lazy): no additional
...
arguments.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34952 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-08 15:35:05 +00:00
nobu
0b2c4f43d2
* enumerator.c: add Enumerable#lazy. based on the patch by
...
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
2012-03-08 15:30:28 +00:00
nobu
e160610200
* enumerator.c (enumerator_each, generator_each): pass arguments to
...
the block with yielder.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34950 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-03-08 15:26:01 +00:00
matz
3052f75db4
* enumerator.c (enumerator_rewind): update the documentation.
...
fixed : #6053
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34712 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-20 17:59:43 +00:00
drbrain
a63b86e2a8
* enumerator.c: Document use of Enumerator.new for creating a lazy
...
enumeration for filtering/chaining. [ruby-trunk - Feature #707 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34586 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-02-13 21:19:11 +00:00
nobu
8e6e8e6288
* use RB_TYPE_P which is optimized for constant types, instead of
...
comparison with TYPE.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-09-29 11:07:45 +00:00
drbrain
d137810d3a
* enumerator.c: Remove "enumeration sequenced by".
...
[Ruby 1.9 - Bug #4757 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-07-09 00:25:27 +00:00
akr
e7996eb3cc
* internal.h: declare internal functions here.
...
* 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-17 22:43:38 +00:00
ryan
ffe4aff8b3
More clarification for enumerator_feed
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31897 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-06-01 21:16:05 +00:00
ryan
f4273e88a8
Extra formatting and clarification of enumerator_feed [ #4757 ]
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31879 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-31 23:19:50 +00:00
drbrain
6cfb4b614a
* enumerator.c: Improve documentation. Patch by Dave Copeland.
...
[Ruby 1.9 - Bug #4757 ]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31704 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-05-22 23:33:21 +00:00
nobu
25b9eb5e57
* include/ruby/ruby.h (rb_data_type_t): restructured. [ruby-dev:41862]
...
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-07-18 07:31:54 +00:00
nobu
45f6fbf339
* removed trailing spaces.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28085 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-29 18:51:39 +00:00
marcandre
7729de4d91
* array.c: Documentation: change => in call-seq to ->.
...
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-17 21:07:33 +00:00
marcandre
1dee5e34a3
* error.c: RDoc for subclasses of Exception. [ruby-core:28394]
...
* 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-05-08 04:50:09 +00:00
akr
309077c9ae
* enumerator.c (inspect_enumerator): don't raise for uninitialized
...
enumerator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27322 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-04-12 13:49:44 +00:00
matz
78a59da8bc
* enumerator.c: move implementation of each_slice, each_cons,
...
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
2010-02-03 01:29:44 +00:00
mame
ae8dc9b722
* vm_eval.c (rb_iterate): pass current block when the argument bl_proc
...
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-12-20 12:31:26 +00:00
mame
61ec623860
* enumerator.c (yielder_yield_push): Yielder#<< should return self.
...
[ruby-dev:39660]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-11 16:32:34 +00:00
akr
b9e0294eda
fix typos.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25635 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-11-03 17:46:28 +00:00
matz
0580ba0611
* array.c (rb_ary_to_ary): do not use #respond_to? to detect
...
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-10-29 04:55:10 +00:00
nobu
40e50764f4
* enumerator.c (enumerator_block_call): extracted.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25164 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-29 15:37:28 +00:00
nobu
9c1e2b4fb7
* enumerator.c (enumerator_data_type): typed.
...
(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-09-09 02:46:00 +00:00
matz
c9775b0382
* enumerator.c (next_i): typo fixed (reached at end -> reached an
...
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-27 22:28:15 +00:00
akr
c89714924c
fix rdoc.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-22 03:40:35 +00:00
akr
b2a83ef6f2
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-22 03:19:53 +00:00
akr
461bd62fec
* enumerator.c (ary2sv): add dup argument.
...
(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-21 15:51:35 +00:00
akr
7609494ffd
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24618 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-21 15:18:57 +00:00
akr
3a855da47b
* enumerator.c (get_next_values): extracted from
...
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-21 13:39:35 +00:00
akr
ce46bc6345
rdoc update.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-19 20:26:38 +00:00
akr
0c0f754400
* enumerator.c (next_init): don't clear feedvalue.
...
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24588 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-08-19 17:32:56 +00:00
akr
3b4949ffa8
* enumerator.c: implement Enumerator#{next_values,peek_values,feed}
...
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-19 16:36:00 +00:00
akr
2772c80ce0
* enumerator.c (enumerator_peek): new method Enumerator#peek.
...
(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-08-18 12:02:53 +00:00