From: MonkeeSage Date: 2007-12-04T21:34:59+09:00 Subject: Re: Why are "Array#push" and "pop" not "push!" and "pop!"? On Dec 4, 5:23 am, MonkeeSage wrote: > On Dec 4, 3:02 am, "David A. Black" wrote: > > > They inherently change their receivers, but that's a separate matter > > from the !. > > Well...99% of the time it is, except when the ! only serves to > indicate that it operates in-place (String#reverse!, Hash#update!, and > probably a few others I can't think of offhand*). That's why I > characterized the ! as "either-or-both" regarding in-place/dangerous. > Even if it's not a good idea or breaks with the common usage, it is > used that way at least a few times in stdlib. > > * Oh yeah, and I just remembered #power! (on Bignum I think) which > isn't dangerous and doesn't modify the receiver...it just raises to a > power. Where the heck did the bang come from?! > > Regards, > Jordan Few more methods where the bang only indicates in-place operation: String#succ!, Array#reverse!, Array#collect!, Array#sort! Regards, Jordan