From: David Alan Black Date: 2002-07-27T23:55:46+09:00 Subject: Re: merge procs Hello -- On Sat, 27 Jul 2002, Tom Sawyer wrote: > okay, i've been staring blankly at this thing for almost 2 days now. i > can't seem to think of a solution. > > the problem i'm having can be solved if i can get two seperate Procs to > execute under the same scope: > > p = Proc.new { > x = 10 > } > > q = Proc.New { > puts "i know what x is #{x}" > } > > r = p + q # how? > > If x comes into scope before the procs are defined, they can both see x: x = nil pr1 = proc { x = 10 } pr2 = proc { puts "x is #{x}" } pr1.call pr2.call # x is 10 > in general my problem is that i need to keep one processes seperate so > that it is reusable. I don't follow that -- ? David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav