[#4595] New block syntax — Daniel Amelang <daniel.amelang@...>

I'm really sorry if this isn't the place to talk about this. I've

25 messages 2005/03/21
[#4606] Re: New block syntax — "David A. Black" <dblack@...> 2005/03/21

Hi --

[#4629] Re: New block syntax — "Sean E. Russell" <ser@...> 2005/03/30

On Monday 21 March 2005 16:17, David A. Black wrote:

[#4648] about REXML::Encoding — speakillof <speakillof@...>

Hi.

15 messages 2005/03/31
[#4659] Re: about REXML::Encoding — "Sean E. Russell" <ser@...> 2005/04/04

On Thursday 31 March 2005 09:44, speakillof wrote:

Re: Allowing "?" in struct members

From: Daniel Berger <djberg96@...>
Date: 2005-03-17 22:19:28 UTC
List: ruby-core #4584
--- Nathaniel Talbott <ntalbott@gmail.com> wrote:
> On Thu, 17 Mar 2005 23:09:56 +0900, Florian Gro> <florgro@gmail.com> wrote:

<snip>

> While I like this idea, I wonder what should be done
> with the following:
> 
>   class C
>     attr_accessor :foo?
>     attr_accessor :foo
>   end
> 
> Throw an error? Kill 'C#foo?' while adding 'C#foo'?
> I'm not sure what
> would make sense.

Do nothing.  The "foo=" method would be redefined in
the second attr_accessor call.  The "foo", "foo?" and
"foo=" methods would then all exist.

After all, you can do this:

class C
   attr_accessor :foo
   attr_accessor :foo
end

And nary a peep from Ruby, even with -w -d.

Regards,

Dan


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Small Business - Try our new resources site!
http://smallbusiness.yahoo.com/resources/ 

In This Thread

Prev Next