[#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: Florian Gro<florgro@...>
Date: 2005-03-17 14:09:56 UTC
List: ruby-core #4578
Yukihiro Matsumoto wrote:

> It's intentional, so that it shouldn't be a bug.   But your message
> made me think having field names with "?" can be valid if field
> accessor is disabled for such cases.

Though I wonder if having "foo?" and "foo=" for boolean accessors like 
flags would not be useful.

For example I'm frequently using things like Contract.check_fulfills and 
.check_fulfills= and I think that

   if Contract.check_fulfills? then
     ...
   end

just looks nicer than

   if Contract.check_fulfills
     ...
   end

OTOH I totally dislike .foo?= because the double combinator just looks 
ugly...

So if this were to be implemented I think attr_accessor :foo? should 
create .foo? and .foo= -- and Struct.new(:foo?) then would also be similar.


In This Thread