[#407] New feature for Ruby? — Clemens.Hintze@...

Hi all,

27 messages 1999/07/01
[#413] Re: New feature for Ruby? — matz@... (Yukihiro Matsumoto) 1999/07/01

Hi Clemens,

[#416] Re: New feature for Ruby? — Clemens Hintze <c.hintze@...> 1999/07/01

On Thu, 01 Jul 1999, Yukihiro Matsumoto wrote:

[#418] Re: New feature for Ruby? — gotoken@... (GOTO Kentaro) 1999/07/01

Hi

[#426] Re: New feature for Ruby? — gotoken@... (GOTO Kentaro) 1999/07/02

Hi,

[#440] Now another totally different ;-) — Clemens Hintze <c.hintze@...>

Hi,

21 messages 1999/07/09
[#441] Re: Now another totally different ;-) — matz@... (Yukihiro Matsumoto) 1999/07/09

Hi,

[#442] Re: Now another totally different ;-) — Clemens Hintze <c.hintze@...> 1999/07/09

On Fri, 09 Jul 1999, you wrote:

[#443] — Michael Hohn <hohn@...>

Hello,

26 messages 1999/07/09
[#444] interactive ruby, debugger — gotoken@... (GOTO Kentaro) 1999/07/09

Hi Michael,

[ruby-talk:00534] Re: Another way for this? And a new proposal!

From: Clemens Hintze <c.hintze@...>
Date: 1999-07-26 06:11:36 UTC
List: ruby-talk #534
On Mon, 26 Jul 1999, you wrote:
>Hi,
>
>In message "[ruby-talk:00532] Re: Another way for this? And a new proposal!"
>    on 99/07/25, Clemens Hintze <c.hintze@gmx.net> writes:
>

[...]

>
>|>|	def each(aBlock=(begin lambda rescue nil end))
>|>|	   @list1.each aBlock
>|>|	   @list2.each aBlock
>|>|	end
>
>Well, it's ugly.

I will remember it for future usage :-) But I will try to avoid it
and use the `&' mechanism...

[...]

>|
>|	anyObject.anyMethod &blk
>|or
>|	anyObject.anyMethod blk
>
>Use former.  I think it's better way.  'def foo(block=lambda)' trick
>is older than the block argument.

Okay! Perhaps a hint in FAQ or another document for beginners like
me? :-) It would be better, if there is a recommended way-of-doing.

[...]

>Blocks are not objects, so it's not possible to return blocks.  As I
>said before, Proc instances are objectified block, just like Method
>instances are objectified methods which themselves are not objects.

Okay! Now I have understood. Since I have thought all the time, that
block also are objects (ALL things are object in Ruby ;-) I was not
aware that the difference is exactly there: block aren't instances,
Proc objects are!

Thanks for your patient. :-)

>
>                                                matz.

Cle

In This Thread