aris
#1
Issue #7382 has been reported by tadf (tadayoshi funaba).
Bug #7382: Struct#each_pairのyieldと他のeach_pairのそれの相違
https://bugs.ruby-lang.org/issues/7382
Author: tadf (tadayoshi funaba)
Status: Open
Priority: Low
Assignee:
Category:
Target version:
ruby -v: ruby 2.0.0dev (2012-11-18 trunk 37708) [i686-linux]
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}
Issue #7382 has been updated by matz (Yukihiro M.).
Assignee set to nobu (Nobuyoshi N.)
Target version set to 2.0.0
おっしゃることはもっともなので、直してトラブルが起きないかどうか確認したいです。
中田さん、お願いしていい?
Matz.
Bug #7382: Struct#each_pairのyieldと他のeach_pairのそれの相違
https://bugs.ruby-lang.org/issues/7382#change-33057
Author: tadf (tadayoshi funaba)
Status: Open
Priority: Low
Assignee: nobu (Nobuyoshi N.)
Category:
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-18 trunk 37708) [i686-linux]
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}
Issue #7382 has been updated by matz (Yukihiro M.).
Status changed from Open to Assigned
Bug #7382: Struct#each_pairのyieldと他のeach_pairのそれの相違
https://bugs.ruby-lang.org/issues/7382#change-33058
Author: tadf (tadayoshi funaba)
Status: Assigned
Priority: Low
Assignee: nobu (Nobuyoshi N.)
Category:
Target version: 2.0.0
ruby -v: ruby 2.0.0dev (2012-11-18 trunk 37708) [i686-linux]
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}