[#955] Ruby 1.4.3 — Yukihiro Matsumoto <matz@...>
Ruby 1.4.3 is out, check out:
1 message
1999/12/07
[#961] Ruby compileable by C++ compiler? — Clemens Hintze <c.hintze@...>
Hi,
8 messages
1999/12/10
[#962] Re: Ruby compileable by C++ compiler?
— matz@... (Yukihiro Matsumoto)
1999/12/10
Hi,
[#963] Re: Ruby compileable by C++ compiler?
— Clemens Hintze <clemens.hintze@...>
1999/12/10
Wei,
[#964] Bastion or SecurityManager for Ruby? — Clemens Hintze <clemens.hintze@...>
Hi,
15 messages
1999/12/10
[#966] Re: Bastion or SecurityManager for Ruby?
— nakajima kengo<ringo@...>
1999/12/10
Hello Clemens,
[#967] Re: Bastion or SecurityManager for Ruby?
— matz@... (Yukihiro Matsumoto)
1999/12/10
Hi,
[#989] a question about to_i — Friedrich Dominicus <Friedrich.Dominicus@...>
Sorry, I'm quite new to ruby. But I encounterd the following problem. If
17 messages
1999/12/19
[ruby-talk:01012] Re: Blocks, Procs, and iterators
From:
matz@... (Yukihiro Matsumoto)
Date:
1999-12-31 07:52:58 UTC
List:
ruby-talk #1012
In message "[ruby-talk:01008] Blocks, Procs, and iterators"
on 99/12/30, Dave Thomas <Dave@thomases.com> writes:
|Is there a difference between
|
| def fred
| yield 1
| yield 2
| end
|
|and
|
| def fred(&block)
| block.call(1)
| block.call(2)
| end
Almost same. The differences are
(1) &block create a Proc object, yield does not; thus yield version
is bit faster.
(2) With &block, you can check the number of parameters (variables
surrounded by | |) in block with Proc#arity method. There's no
such way for a unobjectified block.
(3) It's much easier to pass a block to another method with &block.
Hope this helps.
matz.