On Thu, Aug 05, 2004 at 07:16:29PM +0900, Robert Klemme wrote:
> > - Argument passing, a block isn't strict about the arguments
> >   it gets passed, (i.e. it can take any argument).  A Proc
> >   object in contrast is strict (like methods).  The reason I
> >   can think of is that it is often usefull not to get all arguments
> >   in a block, i.e. 3.times{ puts "Hi, world!" }
> 
> I don't know what exactly you mean by this.  Argument passing is the same
> for blocks and procs IMHO.  Can you explain the difference?

>> def foo; yield 1,2 end;  foo { |a,b,c,d| }
=> nil
>> lambda{|a,b,c,d|}.call 1, 2
ArgumentError: wrong number of arguments (2 for 4)
        from (irb):2
        from (irb):2:in `call'
        from (irb):2
>> Proc.new{|a,b,c,d|}.call 1, 2
=> nil
>> RUBY_VERSION
=> "1.8.2"
>> RUBY_RELEASE_DATE
=> "2004-07-30"

-- 
Running Debian GNU/Linux Sid (unstable)
batsman dot geo at yahoo dot com