[#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:03888] Re: Array.uniq! returning nil

From: "NAKAMURA, Hiroshi" <nahi@...>
Date: 2000-07-07 02:06:03 UTC
List: ruby-talk #3888
Hi, bang-thread-folks,

> From: Yukihiro Matsumoto
> Sent: Thursday, July 06, 2000 7:55 PM

> |> 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.

Matz, at first, I have to say that I have ever seen this
kind of objection by you somewhere.  I'm sorry.

> Currently I feel no need for self-modifying, non-conditional
> combination.  Basicly one should use copying (non-bang) version of the
> methods.  When he/she really wants to enhance performance, then he/she
> can use bang version at the risk of himself/herself.  I think you can
> pay the cost of making new local variable for the performance tuning,
> which is impossible for Python's immutable strings.

He/She really wants to enhance performance, and is ready for paying his/her risk.
Besides this, he/she wants to do method-chaining, I think.

p aString.gsub!( "foo", "bar" ).split( // ).uniq!.to_s


BTW, I tend to avoid method-chaining style (because of hardly
debugging.)  So I will use 'gsub!?' or 'gsub!&' instead of
'gsub!' if spec. would changed.  To say the truth, *I* am
satisfied with current behaviour of 'foo' and 'foo!'.

// NaHi

In This Thread

Prev Next