Dave Thomas <Dave / PragmaticProgrammer.com> writes:

> >  What do you expect with
> > 
> >    a = [1]
> >    3.times {{
> >       a << 2
> >    }}
> >    p a
> 
> [1,2,2,2], the same as if you passed 'a' in to a method

Guy just pointed out that the question might be: "how many times to I
expect 'a' to get initialized with it's default value?".

The reason I expect [1,2,2,2] is that I'd expect just one
initialization, just before the block is entered for the first time.

Dave