"Jani Monoses" <jani / iv.ro> schrieb im Newsbeitrag
news:414EC550.2040700 / iv.ro...
> Hello
>
> what is the criterion for methods to have a ! terminated variant in the
> standard ruby APIs?
> For instance in String strip has a receiver-modifying counterpart but
> ljust does not.
> Is it that the result fits in the same memory? (strip returns a string
> at most as long as the original while just can return a much longer one)

Normally the rule is that the method modifies the current instance as
opposed to the creation of a new instance (e.g. String#gsub! and
String#gsub).  But that convention is not followed consistently in the std
lib.   I guess the explanatory text contains "historic reasons" somewhere.
:-}

Kind regards

    robert