Bug #7382
Struct#each_pairのyieldと他のeach_pairのそれの相違
Description
Struct#each_pairが他のeach_pairと異なります。
他はENVなども含めてassocで、Structだけvaluesなので解りにくいです。
require 'ostruct'
h = {'a'=>1, 'b'=>2}
S = Struct.new('S', 'a', 'b')
s = S.new(1, 2)
o = OpenStruct.new(h)
h.each_pair{|x| p x}
s.each_pair{|x| p x}
o.each_pair{|x| p x}
Associated revisions
struct.c: yield assoc in each_pair
- struct.c (rb_struct_each_pair): yield associated pairs so that an unsplat argument can get both, for consistency with Hash, OpenStruct, and etc. [ruby-dev:46533] [Bug #7382]
struct.c: yield assoc in each_pair
- struct.c (rb_struct_each_pair): yield associated pairs so that an unsplat argument can get both, for consistency with Hash, OpenStruct, and etc. [ruby-dev:46533] [Bug #7382]
struct.c: yield assoc in each_pair
- struct.c (rb_struct_each_pair): yield associated pairs so that an unsplat argument can get both, for consistency with Hash, OpenStruct, and etc. [ruby-dev:46533] [Bug #7382]
struct.c: yield assoc in each_pair
- struct.c (rb_struct_each_pair): yield associated pairs so that an unsplat argument can get both, for consistency with Hash, OpenStruct, and etc. [ruby-dev:46533] [Bug #7382]
struct.c: yield assoc in each_pair
- struct.c (rb_struct_each_pair): yield associated pairs so that an unsplat argument can get both, for consistency with Hash, OpenStruct, and etc. [ruby-dev:46533] [Bug #7382]
struct.c: yield assoc in each_pair
- struct.c (rb_struct_each_pair): yield associated pairs so that an unsplat argument can get both, for consistency with Hash, OpenStruct, and etc. [ruby-dev:46533] [Bug #7382]
struct.c: fix typo
- struct.c (rb_struct_each_pair): fix typo. [Bug #7382]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37722 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
struct.c: fix typo
- struct.c (rb_struct_each_pair): fix typo. [Bug #7382]
struct.c: fix typo
- struct.c (rb_struct_each_pair): fix typo. [Bug #7382]
struct.c: fix typo
- struct.c (rb_struct_each_pair): fix typo. [Bug #7382]
struct.c: fix typo
- struct.c (rb_struct_each_pair): fix typo. [Bug #7382]
struct.c: fix typo
- struct.c (rb_struct_each_pair): fix typo. [Bug #7382]
struct.c: fix typo
- struct.c (rb_struct_each_pair): fix typo. [Bug #7382]
History
Updated by matz (Yukihiro Matsumoto) over 6 years ago
- Assignee set to nobu (Nobuyoshi Nakada)
- Target version set to 2.0.0
おっしゃることはもっともなので、直してトラブルが起きないかどうか確認したいです。
中田さん、お願いしていい?
Matz.
Updated by matz (Yukihiro Matsumoto) over 6 years ago
- Status changed from Open to Assigned
Updated by nobu (Nobuyoshi Nakada) over 6 years ago
- Status changed from Assigned to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r37721.
tadayoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
struct.c: yield assoc in each_pair
- struct.c (rb_struct_each_pair): yield associated pairs so that an unsplat argument can get both, for consistency with Hash, OpenStruct, and etc. [ruby-dev:46533] [Bug #7382]
struct.c: yield assoc in each_pair
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e