From: Sam Kong Date: 2006-03-01T15:53:36+09:00 Subject: Re: What am I missing with this closure example? hitesh.jasani@gmail.com wrote: > Like konsu states, you have two different closures. Here's a little > rewrite of your code that works with one closure. > > def f > x = 0 > one = lambda {x += 1; puts x} > two = lambda {puts x} > [one, two] > end > > one, two = f > > one.call > two.call > one.call > two.call > > > => with results of > 1 > 1 > 2 > 2 Aha~ Now I see the difference. Thanks everyone. Sam