From: Tim Hunter Date: 2007-12-07T23:33:36+09:00 Subject: Re: Dynamic local vars Jordan Callicoat wrote: > > Not so much like a C macro, but more like a C struct...you could...use > a Struct ;) > > V = Struct.new(:x, :y).new(nil, nil) > > def bar > V.x = 10 > V.y = 20 > end > def foo > bar > puts V.x, V.y > end > > Regards, > Jordan Of course the Struct is not actually allowing him to share data between bar and foo. It's the global constant V that's doing that. -- Posted via http://www.ruby-forum.com/.