* enum.c: [DOC] Add simple example of Enumerable#zip [ci skip]

Patch by @nruth on documenting-ruby/ruby#22
  https://github.com/documenting-ruby/ruby/pull/22


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44672 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
zzak 2014-01-21 07:45:55 +00:00
Родитель ad9d4f0211
Коммит f72e5b8bd3
2 изменённых файлов: 7 добавлений и 0 удалений

Просмотреть файл

@ -1,3 +1,9 @@
Tue Jan 21 16:43:22 2014 Zachary Scott <e@zzak.io>
* enum.c: [DOC] Add simple example of Enumerable#zip [ci skip]
Patch by @nruth on documenting-ruby/ruby#22
https://github.com/documenting-ruby/ruby/pull/22
Tue Jan 21 16:26:44 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread_pthread.c (rb_thread_create_timer_thread): expand timer

1
enum.c
Просмотреть файл

@ -2078,6 +2078,7 @@ zip_i(RB_BLOCK_CALL_FUNC_ARGLIST(val, memoval))
* a = [ 4, 5, 6 ]
* b = [ 7, 8, 9 ]
*
* a.zip(b) #=> [[4, 7], [5, 8], [6, 9]]
* [1, 2, 3].zip(a, b) #=> [[1, 4, 7], [2, 5, 8], [3, 6, 9]]
* [1, 2].zip(a, b) #=> [[1, 4, 7], [2, 5, 8]]
* a.zip([1, 2], [8]) #=> [[4, 1, 8], [5, 2, nil], [6, nil, nil]]