From: Greg McIntyre Date: 2003-11-19T22:57:21+09:00 Subject: Re: x.f! RCR Maik Schmidt wrote: > Greg McIntyre wrote: > > It bugs me that some methods have a ! on the end and some don't. It > > seems very arbitrary and inconsistent to me. And the same for ?. > > Hmm, maybe the whole thing is much simpler than you think: > > From matz' "Ruby in a nutshell": > > > You can append ! or ? to the name of a Ruby method. Traditionally, > ! is appended to a method that requires more caution than the variant > of the same name without !. A question mark ? is appended to a method > that determines the state of a Boolean value, true or false. > Yes, but it wasn't until about 15 minutes ago that I understood why, in the standard library, some methods have ! and some don't. That is, what the actual rationale is. I'm not talking about capability, I'm talking about actual practice. Until 15 mintues ago, it just seemed like inconsistent use. And there is still some inconsistency. I think Array#delete_if should be Array#delete_if!, for example. I think it's a subtle issue. Too subtle. If it took me months of being a Ruby enthusiast to pay enough attention to figure it out, I think it's probably a bit too tricky... but maybe it's just me being stupid. ?:) -- Greg McIntyre ======[ greg@puyo.cjb.net ]===[ http://puyo.cjb.net ]===