From: Robert Klemme Date: 2005-02-15T01:44:58+09:00 Subject: Re: attr "Martin DeMello" schrieb im Newsbeitrag news:At4Qd.388402$6l.353973@pd7tw2no... > Zach Dennis wrote: > > > > I have failed to see when using three state's is needed. Could you > > provide an example where "my_obj.a?" would behave different if nil/false > > meant nil/maybe ? > > It'd be nice to have an operator like || that only failed for nil - that > way 'false' valued variables wouldn't be splatted by the a ||= b idiom. > > martin Isn't #nil? sufficient? foo = nil 5.times do foo.nil? and begin foo = false puts "changed" end end Kind regards robert