[#3986] Re: Principle of least effort -- another Ruby virtue. — Andrew Hunt <andy@...>

> Principle of Least Effort.

14 messages 2000/07/14

[#4043] What are you using Ruby for? — Dave Thomas <Dave@...>

16 messages 2000/07/16

[#4139] Facilitating Ruby self-propagation with the rig-it autopolymorph application. — Conrad Schneiker <schneik@...>

Hi,

11 messages 2000/07/20

[ruby-talk:03862] Re: Array.uniq! returning nil

From: "Conrad Schneiker" <schneiker@...>
Date: 2000-07-06 09:24:20 UTC
List: ruby-talk #3862
Hi,

"Yukihiro Matsumoto" writes,
>
> In message "[ruby-talk:03851] Re: Array.uniq! returning nil"
>     on 00/07/06, "NAKAMURA, Hiroshi" <nahi@keynauts.com> writes:
>
> |> Hmm, I thought I (we) came to the negative conclusion.
>
> |Accoding Blade's nice looking threading view;
>
|http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-dev/9052?9024-9551
,
> |I cannot find objection to [ruby-dev:9096] and [ruby-dev:9146].
> |I thought that proposition could be accepted (for me, at least).
>
> Didn't I raise objection?  Well, perhaps I forgot to say my opinion.
>
> |Nishi-san's proposition in [ruby-dev:9096]:
> |  String#gsub   => create substituted string and returns it.
> |  String#gsub!  => substitutes itself and returns self
> |  String#gsub!? => substitutes itself and returns if modification is done
or not.
> |  String#gsub?  => create substituted string and returns if modification
is done or not. !?!?
>
> I can agree with the possibility of the combination of modify/copy,
> modified-or-unmodified-string/modified-string-or-nil.  But I don't
> feel '?' is a good name sign for it.

Neither do I.

However, there don't seem to be many alternative characters that wouldn't
look too strange, confusing, or cryptic. Maybe just @, $, %, &.

% is suggestive of telling you if the % modification was more than zero.

    String#gsub
    String#gsub!
    String#gsub!%
    String#gsub%

& is suggestive of trying something & telling you if it succeeded.

    String#gsub
    String#gsub!
    String#gsub!&
    String#gsub&

Conrad.



In This Thread