[#1491] bug — Mathieu Bouchard <matju@...>
6 messages
2003/09/01
[#1492] non-blocking mode behavior (Re: bug)
— nobu.nokada@...
2003/09/01
Hi,
[#1512] New tests — Dave Thomas <Dave@...>
I was looking through the new test/ruby/* stuff just now, and notices
6 messages
2003/09/05
[#1533] GC disable / enable question — Torsten Rueger <torsten.rueger@...>
Moi,
7 messages
2003/09/17
[#1534] Re: GC disable / enable question
— nobu.nokada@...
2003/09/17
Hi,
[#1541] How to debug ? — Torsten Rueger <torsten.rueger@...>
Moi,
6 messages
2003/09/19
[#1542] Re: How to debug ?
— ts <decoux@...>
2003/09/19
>>>>> "T" == Torsten Rueger <torsten.rueger@hiit.fi> writes:
[#1551] Hashes as keys — "Nathaniel Talbott" <nathaniel@...>
I was just playing around with Hash#hash and discovered that you can't use a
13 messages
2003/09/23
[#1552] Re: Hashes as keys
— Jim Freeze <jim@...>
2003/09/23
On Wednesday, 24 September 2003 at 6:21:33 +0900, Nathaniel Talbott wrote:
[#1556] ostruct.rb patch — "Nathaniel Talbott" <nathaniel@...>
I've been finding OpenStruct to be very useful lately, and then I discovered
9 messages
2003/09/24
[#1557] Re: ostruct.rb patch
— "NAKAMURA, Hiroshi" <nahi@...>
2003/09/24
Hi, Nathaniel,
Re: String#downcase! bug/oddness (?)
From:
"Gavin Sinclair" <gsinclair@...>
Date:
2003-09-03 01:16:05 UTC
List:
ruby-core #1502
> This may or may not be considered a bug, but I don't see it documented > anywhere, and it's somewhat odd IMO: > > "A".downcase! => "a" > "a".downcase! => nil It's common, and I think controversial, that bang methods typically return nil when they don't change their receiver. I would definitely prefer that they returned the same as their non-in-place counterparts, but there was a clever example of uniq vs uniq! in ruby-talk recently which gave me food for thought. > Now, returns for bang-functions might not seem useful, but consider when > you have something like: > > get_a_big_string.downcase! > > You can presumably gain efficiency by operating on the existing string, > instead of copying it. This applies to most of the string functions, > IMHO, but it's just my opinion after all. Your presumption could well be wrong. Once upon a time, I got the idea that bang methods are usually implemented by generating the desired value and using #replace to perform the "in-place" aspect. But probably I'm wrong. FWIW, I've become accustomed to thinking of bang methods purely as statements. Just like in English, a sentence ending in "!" is commonly a command. Gavin