From: Greg McIntyre Date: 2003-11-20T07:42:16+09:00 Subject: ! usage Michael Neumann wrote: > My understanding is, that "delete" is a destructive word itself, so it > doesn't need to be marked explicitly as "dangerous". If you need a > non-destructive delete_if version, better use the Enumerable#reject > method, which IMHO describes better it's internal sematics. Here, it's > destructive counterpart, reject! exists. > > Your suggestion is that delete_if does not delete anything (it creates > a new array), where delete_if! would. Principle of Least Surprise? Not > for me! That isn't my suggestion, but we do have conflicting POLS. :) My suggestion is that one _should_ be able to do this: a = [1,2,3] a.join! with only Array#join defined. Basically I see inconsistency. Personally I'd expect delete_if to have a ! because it modifies the receiver like map! and reject!, regardless of whether it's clear. Clarity is not just subjective, it's highly subjective! :) So _is_ there a rule or mnemonic for ! usage in method names, other than "danger"? Is there a technical rule? In the standard library it seems to be that ! is used for in-place transformations to the same class; is that it? -- Greg McIntyre ======[ greg@puyo.cjb.net ]===[ http://puyo.cjb.net ]===