[#863] RDtool-0.5.0 — Toshiro Kuwabara <toshirok@...3.so-net.ne.jp>

Hi,

18 messages 1999/10/23
[#864] Re: RDtool-0.5.0 — matz@... (Yukihiro Matsumoto) 1999/10/26

Hi,

[ruby-talk:00877] local / dynamic variables

From: ts <decoux@...>
Date: 1999-10-29 17:24:38 UTC
List: ruby-talk #877

 Hi,

 This is probably a stupid question, but why in a block a variable is not
 always dynamic when this variable is defined between | |  ?

 i.e. :

 a = [1]; i = 0; a.each {|i| p i } # i is a local variable in the block
                                   # at end it erase the previous value of i
 a = [1];        a.each {|i| p i } # i is a dynamic variable


Guy Decoux


In This Thread

Prev Next