From: Hugh Sasse Date: 2005-11-17T01:09:56+09:00 Subject: Re: DRb Crashing On Thu, 17 Nov 2005, James Edward Gray II wrote: > On Nov 16, 2005, at 9:42 AM, Hugh Sasse wrote: > > > On Thu, 17 Nov 2005, James Edward Gray II wrote: > > > > > > > On Nov 15, 2005, at 6:50 PM, Hugh Sasse wrote: > > > > > > > > > > On Wed, 16 Nov 2005, James Edward Gray II wrote: [...] > > > The Regexp is pretty critical in this case. It validates the data before > > > an > > > otherwise dangerous call to eval(). > > > > > > > while problem = tuplespace.take(["Problem", nil]) > > unless problem.last =~ %r{^\d+(?: [-+*/] \d+)+$} > > puts "Bogus input \'#{problem.last}\', Ted!" #:-) > > else > > tuplespace.write(["Result", "#{problem.last} = #{eval problem.last}"]) > > end > > end > > This is not equivalent. You removed the problem from the TupleSpace whereas > my version leaves it for someone else to solve. Yes, that's true, but it's not really the point I was making -- one could write it back, or whatever. > > I realize this isn't what you were originally asking for and I can try the > change, if you want to see it. To me it's irrelevant though, because > TupleSpace supports a Regexp search and it should not be crashing when doing > it. IIRC it didn't in the past. My point is that if the old way works then maybe it narrows down where to swat the bug. My expectation is that it won't make any difference, but it it isn't tested we won't know. > > This is just a simplified case I cooked up to show the issue. > > James Edward Gray II Hugh