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

From: Aleksi Niemel<aleksi.niemela@...>
Date: 2000-07-04 00:19:50 UTC
List: ruby-talk #3778
> Hmm, how about this?
> 
>   uniqChars = text.split(//).instance_eval{uniq!; self}
> 
> Although it's not handy at all. ;-<

Well, I appreciate your try. This is yet another nice trick to keep in mind.
Anyway I think the problem resides in a fact that uniq! could return nil and
therefore is unsuitable for returning transformed array or to be used in
conjunction with other functions.in.normal.style.

So I guess there's probably good reason why it can return nil. If there is
none, maybe this is a feature which should be changed in 1.6 (or in future).

	- Aleksi

In This Thread

Prev Next