I have a problem with class Struct in Ruby 1.8.0.
The following lines are ok in Ruby 1.6.8, but not
in 1.8.0.
puts defined? File::Stat
p Struct.new(File.name, ‘key’).new
p Struct.new(File::Stat.name, ‘key’).new
Output in ruby 1.6.8 (2002-12-24) [i386-linux-gnu]
constant
#<Struct::File key=nil>
#<Struct::File::Stat key=nil>
Output in ruby 1.8.0 (2003-02-08) [i686-linux]
constant
#<Struct::File key=nil>
t:3:in `new’: identifier File::Stat needs to be constant (NameError)
from t:3
Is this new behaviour intended?
Klaus Spreckelsen