Граф коммитов

189 Коммитов

Автор SHA1 Сообщение Дата
nobu 786e4ce25a * enum.c: use constants in id.h.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29637 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-10-30 00:40:56 +00:00
naruse 5c132d0ad2 * enum.c (enum_zip): fix typo of rdoc.
patched by Andrei Kulakov [ruby-core:31974]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29156 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-09-01 05:36:31 +00:00
naruse fee5e4ff5f * enum.c (enum_inject): fix typo of rdoc.
patched by Andrei Kulakov [ruby-core:31768]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29043 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-08-19 02:12:32 +00:00
marcandre 165ebcd5ac * enum.c (zip): rdoc fix, patch by okkez [ruby-dev:41737]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-27 03:10:20 +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 c5b5ab0935 * enum.c: Documentation: small fixes
* file.c: ditto

* io.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27874 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 21:51:01 +00:00
marcandre c1ecff1b1e * hash.c: Documentation: change => in call-seq to ->.
* enum.c: Documentation: whitespace fix for r27865

* error.c: ditto

* file.c: ditto

* io.c: ditto

* load.c: ditto

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27869 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-17 21:31:22 +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 4afa9ed041 * array.c: Harmonize documentation, in particular regarding:
- methods returning enumerators
    - array methods and argument naming (array -> ary, an_array -> new_ary)
    - minor improvements, typo fixed and styling issues

  Other documentation errors fixed:
    - return value was self instead of a new array (or vice-versa) for
      Array#{pop,shift,permutation,repeated_permutation,keep_if}
    - Array#rindex was missing the form with a block.

* dir.c: ditto.

* enum.c: ditto. Modified Enumerable#reverse_each' documentation to clarify
  that #each will be finish before any element is yielded.

* error.c: ditto.

* gc.c: ditto.

* hash.c: ditto.

* io.c: ditto. IO#{codepoints,each_codepoint} fixed as per [ruby-core:23948]

* numeric.c: ditto.

* range.c: ditto.

* string.c: ditto.

* struct.c: ditto.

* vm_eval.c: ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27777 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-05-13 05:49:55 +00:00
akr ab284526a4 update doc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27023 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-23 13:59:16 +00:00
akr b5388e8538 update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-19 12:54:01 +00:00
akr ad690e96cf rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26910 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-13 16:40:27 +00:00
matz 8b55878d2a * enum.c (enum_join): remove Enumerable#join. [ruby-core:24786]
* array.c (ary_join_1): use #to_ary to detect recursive array.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-13 05:55:46 +00:00
akr 73fc3b5a34 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26892 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-12 14:00:49 +00:00
mame fec209551a * enum.c (min_ii, max_ii, minmax_ii): remove wrong optimization that
reuses array for yield parameter, which caused unexpected behavior.
  [ruby-core:25989]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26866 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-03-10 12:29:50 +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
akr f7d5887fdb unused variable removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-02 15:14:34 +00:00
matz 970e90dd15 * enum.c (enum_each_entry): new method #each_entry to pack values
from yield into an array.

* lib/set.rb (Set#merge): use Enumerable#each_entry to implement
  Set compatible to 1.8 behavior.  [ruby-core:27985]

* lib/set.rb: replace is_a?(Enumerable) with respond_to?(:each)
  for duck typing.

* lib/set.rb (SortedSet#add): typo fixed.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26540 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-02 08:54:52 +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 c0a0aa0c47 * enum.c (enum_count): remove optimization using #size.
revert r25560.

* vm_eval.c (rb_funcall_no_recursive): remove method.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-31 16:14:38 +00:00
matz 7f2ef1a96e * enum.c (enum_count): call #size using rb_funcall_no_recursive()
to prevent infinite recursive calls.  [ruby-core:24794]

* vm_eval.c (rb_funcall_no_recursive): utility function to check
  direct recursive call.

* vm_eval.c (rb_check_funcall): move from eval.c. [refactoring]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25560 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-29 17:16:05 +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
matz 55bf7f9d40 * enum.c (enum_flat_map): new method that concatenates the values
from given block.  also provides alias #collect_concat.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25456 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-24 17:01:38 +00:00
akr 3e54f0ee1f rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-11 07:39:17 +00:00
akr 31959b52ef * enum.c (slicebefore_ii): use id_eqq.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25222 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-03 23:29:03 +00:00
marcandre 51b89eeb03 enum.c (enum_chunk): Give proper error message if no block given. cf [ruby-core:25912]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25204 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-03 04:55:00 +00:00
akr a21b7ddf26 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 23:10:38 +00:00
akr 5bdef2f984 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 23:02:04 +00:00
akr 2e70b9e70d * enum.c (enum_slice_before): take a pattern if no block given.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25188 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 11:50:11 +00:00
akr e9c728fea3 update rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25185 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-10-02 10:54:31 +00:00
akr 9278fab680 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-27 14:44:43 +00:00
akr 50bbca9d5c * enum.c (enum_minmax): use struct for memo.
(enum_minmax_by): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-27 02:28:57 +00:00
akr 0ff9cf3625 fix rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-27 01:58:07 +00:00
akr fdb3e278f5 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-25 18:29:53 +00:00
akr e6f4473316 rdoc update.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-24 10:35:35 +00:00
akr fc58a6c5bd * enum.c (enum_minmax): reduce comparison.
(enum_minmax_by): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25059 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-23 15:19:13 +00:00
akr 475074d5da * enum.c (enum_chunk): new method Enumerable#chunk.
* enum.c (enum_slice_before): new method Enumerable#slice_before.
  [ruby-dev:38392] [ruby-dev:39240]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-09-22 01:35:53 +00:00
nobu e07cb859cc * suppressed shorten-64-to-32 warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24195 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-18 08:05:32 +00:00
nobu af8f8e5b0e * array.c (recursive_join): use obj to tell if recursion occurs.
[ruby-core:24150]

* enum.c (enum_join): reverted r23966.  [ruby-core:24196]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@24017 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-10 07:30:08 +00:00
nobu 0f2d1527ab * enum.c (DEFINE_ENUMFUNCS): included function signature.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23980 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07 04:36:50 +00:00
nobu e895bc3cdb * enum.c (rb_enum_join): non-nil separator must be convertible to
String.  [ruby-core:24172]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23979 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07 04:34:34 +00:00
matz 9041ac4289 * enum.c (rb_enum_join): should propagate taint to the return
value.  the change was overridden by r23967.  [ruby-core:24176]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-07 03:55:18 +00:00
matz 8c7f7c29b4 * enum.c (enum_to_a): should propagate taint to the return value.
[ruby-core:24152]

* enum.c (enum_sort_by): ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-06 01:03:16 +00:00
nobu def66ceca3 * enum.c (enum_join): deals with self recursive objects to get rid
of infinite recursion.  [ruby-core:24150]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-06 00:04:56 +00:00
nobu e86d1ce77e * enum.c (enum_join): added rdoc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-05 23:15:51 +00:00
matz 9d9986d25c * enum.c (enum_join): add Enumerable#join.
* array.c (ary_join_1): recursive join for Enumerators (and
  objects with #to_a).

* array.c (rb_ary_join): performance tune.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-07-03 18:14:33 +00:00
nobu 01430b6e69 * enum.c (enum_grep): gets rid of type-punning calls.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-30 21:47:14 +00:00
matz 304c060d4a * enum.c (first_i): wrong condition for no argument #first.
[ruby-core:24017]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23846 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-24 22:46:35 +00:00
matz cab726cfac * enum.c (enum_first): should check negative length.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23623 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-03 00:06:40 +00:00
matz 967001d9da * enum.c (first_i): Enumerator#first should consume only what is
needed.   a patch from Marc-Andre Lafortune.  [ruby-core:23661]

* enum.c (enum_first): call to_int once for an argument.  based on
  a patch from Marc-Andre Lafortune.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23622 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-06-03 00:02:14 +00:00