From: Jeff Patterson Date: 2008-03-30T23:45:45+09:00 Subject: Re: stumped Joel VanderWerf wrote: > Joel VanderWerf wrote: > > On second thought, since you're evaling the input, you might want to > hook your simulation engine up to irb. This uses readline, too, but has > the advantage of maintaining program state between lines, so that you > can define local vars, methods, etc. Also, it accepts multiline inputs. > Thanks for your suggestions. I tried the irb approach and while command history is very nice. The error I am (still) getting turns out to stem from the fact that in the loop I was trying to execute, I said "yield" instead of "yield 1". Is there a way to default a parameter passed to a block the same way you can default arguments passed to a method? i.e if @sim is my netlist whose run method reads in the commands, I want to do something like @sim.run{|cyc =1| # ERROR while (cyc>0) ...advance the simulator cyc cycles end } I tried @sim.run{|cyc| cyc ||= 1 ... which keeps the program from bombing but I still get the warning Thanks for your help! Jeff -- Posted via http://www.ruby-forum.com/.