Cameron McBride
11/20/2007 2:08:00 AM
On 11/19/07, S. Robert James <srobertjames@gmail.com> wrote:
> On Nov 19, 6:21 pm, "S. Robert James" <srobertja...@gmail.com> wrote:
> > Lisp programmers often use the REPL (similar to IRB) as a simple way
> > to make an interactive interface to their app. I'd like to do the
> > same thing with irb - that is, define my classes, and load irb in the
> > context.
> >
> > I can get about half way there:
> >
> > require 'irb'
> > IRB.start
> > my_class = MyClass.new(...) # I want this to be the context
> > irb my_class
> >
> > ...works, but you have to type "quit" to load. Is there a better way
> > to leverage IRB from within my code? What do the Ruby hackers say? (I
> > know a lot have a Lisp background, and so wouldn't want Ruby to not
> > have a REPL shell...)
>
> Another, similar problem with the above:
> irb my_class
> conf.prompt_mode = :SIMPLE # This line is ignored
hmmm, I've also had some problems trying to add a command interface to
some code. I found trying to bend IRB to fit the needs seems to be
trickier than just coding up a solution in readline directly. Is that
really the best solution?
Cameron