[#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:04127] Re: Function objects. was: What are you usi ng Ruby for?

From: kjana@... (YANAGAWA Kazuhisa)
Date: 2000-07-19 12:54:49 UTC
List: ruby-talk #4127
In message <E536C8EE2A1FD31195370008C79FFA1F13F66F@world.cinnober.com>
aleksi.niemela@cinnober.com writes:

>   Parameter passing   all supported ways        only plain  (*)
(snip)
>   *) no optional, grouped (*rest) or named parameters allowed, 
>      nor block block association

Parameters for a block is bound as multiple assignment. Therefore you
can:

    <code>
    f = proc { |x, *y| p x, y }
    f.call(1)
    f.call(1, 2, 3)
    
    <display>
    1
    []
    1
    [2, 3]
    

Just FYI.


-- 
kjana@os.xaxon.ne.jp                                  July 19, 2000
Slow and steady wins the race.

In This Thread