In message <3AB026B2 / operamail.com>
ben_tilly / operamail.com writes:

> >How to read the following?
> >{
> >  e =  1
> >  f := 2
> >  f  = 3  #possible typo?
> 
> Why would you this this a typo?

Then the snippet below show what value?

    foo = 0
    bar = 0
    1.times do
      foo = 1
      foo := 2
      bar = foo+1
    end
    
    puts foo, bar 

With the `policy' rules the current implementation probably foo in the
block is judged as block local variable at compile time, thus puts
prints 0 and 3.

However foo can be 1 outside of block and 2 at calculation of bar so 1
and 3 can be printed out. --- Such implementation is not chosen
normaly, thogh.


Introducing new variables at a beginning of the block is better for
me.  Otherwise I should be more careful of where a variable belonging
to, since variables can suddenly become block local in a sequence of
code.


-- 
kjana / os.xaxon.ne.jp                                 March 15, 2001
It is comparison that makes men happy or miserable.