Hi,

At Thu, 3 Oct 2002 01:46:37 +0900,
Kontra, Gergely <kgergely / mlabdial.hit.bme.hu> wrote:
> k='Hello'
> [1,2,3].map {|k| k}
> puts k
> 
> It prints 3 under ruby1!

Yes, using block argument equals to assignment to it.

> Another one:
> 
> def a
>   b=2
> end
> 
> a()
> puts b
> 
> prints 2

Really?  I got this error:

-:6: undefined local variable or method `b' for #<Object:0x402de95c> (NameError)

> I don't see the point why split returns an empty array, when it has a
> *VALID*, but empty input string. It should return an array returning one
> empty element, so [''].

''.split('-', -1) # => ['']

-- 
Nobu Nakada