diff options
| author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-14 08:39:34 +0000 |
|---|---|---|
| committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2005-11-14 08:39:34 +0000 |
| commit | d8b0d69663e79f9bb6e5bb7f43e110baecdb95be (patch) | |
| tree | 801c38d82fce5d37fc09a57348fa7ff8962c6b10 | |
| parent | fa8d73397fd804bc3ecdefda0f6c42f6e2d983ea (diff) | |
| download | ruby-d8b0d69663e79f9bb6e5bb7f43e110baecdb95be.tar.gz ruby-d8b0d69663e79f9bb6e5bb7f43e110baecdb95be.tar.xz ruby-d8b0d69663e79f9bb6e5bb7f43e110baecdb95be.zip | |
* array.c (rb_ary_first): RDoc update from Daniel Berger
<djberg96@yahoo.com>. [ruby-core:06577].
git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8@9534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 5 | ||||
| -rw-r--r-- | array.c | 14 |
2 files changed, 14 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Mon Nov 14 17:36:22 2005 Yukihiro Matsumoto <matz@ruby-lang.org> + + * array.c (rb_ary_first): RDoc update from Daniel Berger + <djberg96@yahoo.com>. [ruby-core:06577]. + Fri Nov 11 10:31:44 2005 Zach Dennis <zdennis@mktec.com> * ext/socket/socket.c: Socket Documentation. [ruby-core:6580] @@ -715,12 +715,16 @@ rb_ary_at(ary, pos) /* * call-seq: * array.first -> obj or nil - * - * Returns the first element of the array. If the array is empty, - * returns <code>nil</code>. - * + * array.first(n) -> an_array + * + * Returns the first element, or the first +n+ elements, of the array. + * If the array is empty, the first form returns <code>nil</code>, and the + * second form returns an empty array. + * * a = [ "q", "r", "s", "t" ] - * a.first #=> "q" + * a.first #=> "q" + * a.first(1) #=> ["q"] + * a.first(3) #=> ["q", "r", "s"] */ static VALUE |
