From: James Edward Gray II Date: 2007-07-13T23:03:27+09:00 Subject: Re: Proposal: runtime-modifying Kernel methods should be keywords On Jul 13, 2007, at 2:09 AM, Nobuyoshi Nakada wrote: > Hi, > > At Fri, 13 Jul 2007 15:55:40 +0900, > Charles Oliver Nutter wrote in [ruby-core:11647]: >>> |- the feature can't be wrapped in another method and maintain >>> the same >>> |behavior as if it were called in the original context >>> | >>> |All those listed so far fit these criteria. >>> >>> String#gsub ? >> >> gsub needs access to internal structures (namely, the in-memory >> representation of a String) but it can successfully be wrapped with >> another method. I think both criteria must be met, since being >> able to >> wrap a method means it's not doing anything weird with the caller's >> logical binding/frame/scope. > > gsub sets $_ in the caller's scope. Which is probably another feature of questionable value. I know it's handy in one-liners, but outside of that code using $_ has been out of fashion for some time now. James Edward Gray II