From: Peter Bunyan Date: 2007-12-06T04:13:43+09:00 Subject: Re: Keeping variables across requires? Ah, thanks. With Ruby I'm used to not having to do global/local things; I didn't know you could create global ones with $. But now I have another problem: The functions I created with lambda {} are now returning -1 as their arity. My new code: befunge.rb --- elsif $instructions.include? operator arguments = [] $instructions[operator].arity.times {arguments.push stack.pop} $instructions[operator].call( *arguments ) else --- befunge-93.rb (just a sample) --- $instructions = {} $instructions["!"] = lambda { |a| stack.push !a} $instructions["`"] = lambda { |a, b| stack.push b>a ? 1 : 0 } $instructions[">"] = lambda { xvel = 1; yvel = 0 } --- -- Posted via http://www.ruby-forum.com/.