From: Bill Kelly Date: 2005-03-22T15:40:31+09:00 Subject: Re: RCR 296: Destructive methods return self From: "Hal Fulton" > > I would almost suggest what I once suggested as a joke: Combine the ! and ? > suffixes. > > gsub! returns self > gsub!? returns self or nil (yes, it looks silly) It looks a little silly, but it seems pretty straightforward to read and understand: "Oh, it's gsub-bang with a question." The occasions when I've cared about the flag returned by the bang methods has typically been associated with some conditional, like: save(data) if data.gsub!?(/foo/, bar) I.e. the ? is not too far from the 'if' so maybe reduces its silliness slightly by giving it something to relate to visually? :) Doesn't seem too heinous to me. Regards, Bill