From: nobu.nokada@... Date: 2003-06-01T16:18:31+09:00 Subject: Re: [RCR] attr_reader :foo? Hi, At Sun, 1 Jun 2003 15:57:23 +0900, Brian Candler wrote: > instance_variables works for me: I get > ["@foo?", "@foo"] attr_(reader|writer|accessor) don't create instance variable itself. When the attribute is assinged, the variable will be created. > I guess the ? is being treated as part of the ? : operator rather than the > variable name: > > @foo?.1:.2 # return .1 if @foo is true or .2 if @foo is false That's right. '!' and '?' are allowed at the end of method names, but not as a part of variable names. -- Nobu Nakada