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

From: matz@... (Yukihiro Matsumoto)
Date: 2000-07-03 17:43:14 UTC
List: ruby-talk #3777
Hi.

In message "[ruby-talk:03771] Re: Array.uniq! returning nil"
    on 00/07/03, Aleksi Niemel<aleksi.niemela@cinnober.com> writes:

|That's good. *Waiting eagerly* :). But even then I guess
|
|  uniqChars = text.split(//).uniq
|
|needs a copy if there're any characters to be removed from the array. And if
|we can't rely on that fact there are always some chars to be removed, it
|seems we can't use Array.uniq!. It's all ok, I can always write

Hmm, how about this?

  uniqChars = text.split(//).instance_eval{uniq!; self}

Although it's not handy at all. ;-<

							matz.

In This Thread

Prev Next