From: Kero Date: 2006-10-18T21:35:09+09:00 Subject: Struct (not) accepting attributes > Sum = Struct.new(:bla, :"sum(value)") > sum = Sum.new(2, 5) => # > sum.send(:"sum(value)") NoMethodError: undefined method `sum(value)' for # > class X > attr_accessor :"sum(value)" > end NameError: invalid attribute name `sum(value)' > class Sum > define_method(:"sum(value)") { "summum!" } > end => # > sum.send(:"sum(value)") => "summum!" Not sure this is an error in ruby (1.8.5) or a misunderstanding from me (about Struct). And yes, I know how to get/set the value anyway: > sum[:"sum(value)"] => 5 > sum["sum(value)"] = 42 => 42 Bye, Kero.