2 ms·
Agreed. True for Ruby too. Its important to remember how closures work, and what variables in the environment are being "closed" over. > message = 'test' > a
by raju 18y ago
Agreed. True for Ruby too. Its important to remember how closures work, and what variables in the environment are being "closed" over.
> message = 'test'
> a = lambda { puts message }
> message = 'test1'
> b = lambda { puts message }
> a.call
test1
> b.call
test1