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

From: "Hal E. Fulton" <hfulton@...>
Date: 2000-07-08 01:16:15 UTC
List: ruby-talk #3896
That's a very interesting idea, Hugh. But how does
the caller know that the cut failed?

Hal

> 
> Thank you.  One more might be a new operator.  I don't know
> what to call it so I will call it cut for now, for the sake
> of argument: 
> 
> a.modifier!().cut.method1.method2
> 
> where cut short-circuits the other methd calls if its receiver
> is nil. Otherwise it returns its receiver, passing it on for 
> the subsequent methods.
> 
> Then nil.cut would be like failure in Icon, the rest of the
> statement is not executed, but nobody gets upset about it.
> 
> I think cut is the wrong name because cut is complelely different
> in prolog, IIRC, and it doesn't look like an operator. <!> might
> look like a conditional cutting action....
> 
> Hugh
> hgs@dmu.ac.uk
> 



In This Thread