ara.t.howard / noaa.gov wrote: > On Fri, 14 Apr 2006, Patrick Hurley wrote: > >>> or just use >>> >>> attr_reader 'variable?' > > wow. you are right. it fails silently on 1.8.1 and throws an error on > 1.8.4. > > don't know what i was thinking!? > > now that i think about it it was one of the reasons i wrote traits! > > very, sorry for noise. > > -a Unfortunately, it looks like they decided to error out rather than take a DWIM approach: # attrtest.rb class Foo attr_accessor :bar?, :baz! end p Foo.instance_methods(false) >ruby -v ruby 1.8.2 (2004-12-25) [sparc-solaris2.10] >ruby attrtest.rb ["bar?", "baz!=", "bar?=", "baz!"] >/opt/bin/ruby -v ruby 1.8.4 (2005-12-24) [sparc-solaris2.10] >/opt/bin/ruby attrtest.rb attrtest.rb:2:in `attr_accessor': invalid attribute name `bar?' (NameError) from attrtest.rb:2 Regards, Dan