From: Brian Candler Date: 2003-02-18T06:27:47+09:00 Subject: Re: How to test for existence of instance variable? On Tue, Feb 18, 2003 at 05:39:34AM +0900, Bill Kelly wrote: > I think defined? might do the trick: > > >> class Foo > >> def initialize > >> p defined? @bar > >> @bar = 123 > >> p defined? @bar Doh, how did I miss that! I keep looking at the class reference and forget that there are actually some reserved words in the language as well :-) Thanks to everyone. B.