aboutsummaryrefslogtreecommitdiffstats
path: root/array.c
Commit message (Collapse)AuthorAgeFilesLines
* * include/ruby/ruby.h: add C APIs.nari2012-10-201-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | VALUE rb_newobj_of(VALUE klass, VALUE flags) #define NEWOBJ_OF(obj,type,klass,flags) These allow to change a allocation strategy depending on klass or flags. * gc.c: ditto * array.c: use new C API. * bignum.c: ditto * class.c: ditto * complex.c: ditto * ext/socket/ancdata.c: ditto * ext/socket/option.c: ditto * hash.c: ditto * io.c: ditto * marshal.c: ditto * numeric.c: ditto * object.c: ditto * random.c: ditto * range.c: ditto * rational.c: ditto * re.c: ditto * string.c: ditto * struct.c: ditto [Feature #7177][Feature #7047] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37275 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c: use rb_random_ulong_limitednobu2012-10-091-15/+25
| | | | | | | | * array.c (rb_ary_sample): use rb_random_ulong_limited, since precision of long may be larger than double. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37126 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove garbages.nobu2012-09-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36996 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c, enum.c: TypeError in zipnobu2012-09-191-1/+2
| | | | | | | | | | * array.c (take_items), enum.c (enum_zip): raise TypeError at non-enumerable objects, not NoMethodError. [ruby-dev:46145] [Bug #7038] * vm_eval.c (rb_check_block_call): check_funcall variant with block function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36989 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_diff, rb_ary_uniq):zzak2012-09-131-5/+22
| | | | | | | | | Enhance documentation for array uniqueness Based on a patch by Robin Dupret [Bug #6872] [ruby-core:47209] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_select):zzak2012-09-131-5/+6
| | | | | | | | | | | Update documentation for Array#select * enum.c (enum_find_all, enum_reject): Update documentation for Enumerable#find_all and Enumerable#reject Based on a patch by Jeff Saracco [Bug #6908] [ruby-core:47285] [Fixes #166 on github] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36964 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add documentation about Array#join(nil). [Bug#5915]naruse2012-07-171-0/+2
| | | | | | | | | | | | We talked about this and it is like following: * maybe ary.join(nil) should always use empty string as a separator, but it disables to specify $, as a seprator through variables. * if nil means '', the conversion is to_s. to_s is not accepted. * nil is a special value, so special behavior is allowed. * use of $ variables is not recommended, so it is not worth to change current behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36421 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c: fill with nilnobu2012-07-141-8/+6
| | | | | | | | * array.c (rb_get_values_at): fill with nil out of range. [ruby-core:43678] [Bug #6203] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36393 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* array.c: no infection by unused separatornobu2012-07-141-2/+2
| | | | | | | | * array.c (rb_ary_join): should not infected by separator if it is not used. [ruby-core:42161][Bug #5902] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36381 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_aref): Added a description of the behavior ofdrbrain2012-07-051-4/+9
| | | | | | | | | | index positioning. [Bug #6680] * array.c (rb_ary_aset): ditto. Reordered sentences for clarity. * string.c (rb_str_aref_m): Added a description of the behavior of index positioning git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36328 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_aref): Updated documentation to indicate thedrbrain2012-07-031-9/+13
| | | | | | | | | | | | starting index is an index into the array or string. Updated examples to show behavior of indexes at the end of an array or string. Based on patch by Marcus Stollsteimer. [Bug #6680] * array.c (rb_ary_aset): ditto. * string.c (rb_str_aref): ditto. Also added descriptive argument names to call-seq section. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_reverse): use ansi style declaration.kosaki2012-06-191-2/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@36140 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Updated Array documentation formatting. Patch by Zacharydrbrain2012-05-311-518/+637
| | | | | | | Scott. [ruby-trunk - Feature #6517] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35858 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * include/ruby/intern.h: Add rb_check_arity, rb_error_arity [#6085]marcandre2012-03-141-9/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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
* * array.c (rb_ary_cat): new function to concat objects into array.nobu2012-03-081-5/+14
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34948 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Fix rdoc for Array#select!marcandre2012-02-101-2/+2
| | | | | | patched by b t [ruby-core:42478] [Bug #5998] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34535 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Fix typoayumin2012-01-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sample): add examples for Array#sample.ayumin2012-01-041-0/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_reject_bang, rb_ary_delete_if): update rdoc.nobu2011-12-151-0/+4
| | | | | | | | documentation from Thomas Leitner <t_leitner AT gmx.at> in [ruby-core:41616]. [Bug #5752] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34048 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_initialize): Improve explanation of Array.newdrbrain2011-10-101-42/+69
| | | | | | | | | | | parameters. Patch by Alvaro Pereyra Rabanal. [Ruby 1.9 - Bug #5425] * array.c (rb_ary_s_try_convert): Fix typo (try => tries) * array.c (rb_ary_rindex): Add spacing for block. * array.c (rb_ary_uniq_bang): Describe block * array.c (rb_ary_uniq): ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Add a description to Array, minor cleanups. Patch bydrbrain2011-10-101-16/+243
| | | | | | | Andrea Singh. [Ruby 1.9 - Bug #5412] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Use + for arguments described in documentation to allowdrbrain2011-10-061-96/+91
| | | | | | | | rdoc -C2 to work better. Remove <code> from method references to allow cross-references in HTML documentation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_initalize): Make Array.new description matchdrbrain2011-10-031-3/+3
| | | | | | | call-seq. Patch by Henry Maddocks. [Ruby 1.9 - Bug #5344] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33389 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_initialize): Add output for examples. Patch bydrbrain2011-10-031-10/+11
| | | | | | | Jonathan Mukai. [Ruby 1.9 - Bug #5216] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_s_create): Add example results for Array::[]. Patchdrbrain2011-10-031-7/+6
| | | | | | | by Jonathan Mukai. [Ruby 1.9 - Bug #5215] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_join_1): should not copy the encoding of non-stringnobu2011-09-291-0/+1
| | | | | | element after string element. [ruby-core:39776] [Bug #5379] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33363 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * use RB_TYPE_P which is optimized for constant types, instead ofnobu2011-09-291-4/+4
| | | | | | comparison with TYPE. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_set_len): new function to set array length.nobu2011-07-291-0/+15
| | | | | | | * vm_eval.c (method_missing): set the length of argv array, to mark arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32740 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: Fix typo. https://github.com/ruby/ruby/pull/36shyouhei2011-07-261-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32673 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_delete_at_m): use simple array literal in rdoc.naruse2011-07-211-1/+1
| | | | | | patched by samuel tonini. [ruby-core:38310] [Bug #5066] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32594 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_reject_bang): should not remove elements which arenobu2011-07-031-21/+13
| | | | | | | not yielded. [Bug #2545] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_reject_bang, rb_ary_delete_if): rejectednobu2011-07-011-20/+49
| | | | | | | elements should be removed. fixed [Bug #2545] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * cont.c (cont_capture): add volatile.naruse2011-06-221-1/+2
| | | | | | | | | | | | | | On clang -O, it is needed to avoid the optimization. With this and llvm/clang's recent fix, clang 3.0 can build ruby-trunk with -O option. * cont.c (cont_capture): use for-loop. * array.c (rb_ary_each): add volatile and use it. * vm_insnhelper.c (vm_call_cfunc): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32201 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * eval.c, hash.c, load.c, proc.c, range.c, thread.c, time.c: don'takr2011-06-181-0/+1
| | | | | | | | | | | | | | | declare internal functions. * internal.h, vm_core.h: declare internal functions. * array.c: include internal.h. * common.mk: update dependency for array.o. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32165 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_drop): Improve documentation. Patch by Caley Woods.drbrain2011-06-161-2/+2
| | | | | | | [Ruby 1.9 - Bug #4858] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32138 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_sort_bang): fix rdoc.naruse2011-04-221-2/+2
| | | | | | patched by burningTyger. https://github.com/ruby/ruby/pull/11 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (ary_join_1): fix array size.akr2011-02-151-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30884 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (array_join): copy the encoding of the first element asnaruse2011-02-151-4/+16
| | | | | | | | | | | | | | | an initial encoding. * array.c (array_join_0): ditto. * array.c (array_join_1): ditto. * array.c (inspect_ary): ditto. * array.c (array_join_1): add an argument to check the appending is first one or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30880 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (inspect_ary): don't taint the inspected result of anaruse2011-02-151-1/+1
| | | | | | recursive array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30878 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: documentation clarification in rotate, rotate!,kosaki2011-02-091-8/+8
| | | | | | | | index, and rindex. [ruby-core:35144] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30830 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Additional fix for r30736naruse2011-01-301-0/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30739 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_uniq_bang): call ARY_SET_LEN(ary, 0) beforenaruse2011-01-301-1/+4
| | | | | | | | | rb_resize_capa because rb_resize_capa expects resized length is smaller than current array length. call rb_ary_unshare before rb_resize_capa because rb_resize_capa losts the reference to original shared array. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30736 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_join): [].join.encoding must be US-ASCII.naruse2011-01-291-1/+1
| | | | | | [ruby-list:47790] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_times): less MEMCPY calls.akr2011-01-171-3/+10
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fix typoskazu2011-01-111-2/+2
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_resize): should care of embeded array when extendingusa2011-01-111-1/+2
| | | | | | | | | | | the array. * array.c (rb_ary_resize): need to set capa when changing the real size of the array. these are latent bugs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_modify): export.nobu2011-01-051-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30470 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_resize): new utility function. [ruby-dev:42912]nobu2011-01-051-0/+45
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30465 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c (rb_ary_dup): should copy contents only. no instancematz2010-12-091-14/+6
| | | | | | | | | | | | variable, no class would be copied. it would affect methods #sort, #reject, #transpose, #uniq, #compact, and #shuffle. [ruby-core:33640] * array.c (rb_ary_reverse_m): ditto. * array.c (rb_ary_rotate_m): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@30148 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * array.c: parenthesize macro arguments.akr2010-12-011-24/+24
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29997 b2dd03c8-39d4-4d8f-98ff-823fe69b080e