Embedding a REPL in a Java application
Per Bothner
per@bothner.com
Sun Nov 15 16:33:00 GMT 2009
On 11/15/2009 07:47 AM, Jamison Hope wrote:
> It sounds like for this to work, I would need to create and hold onto a
> special initial ReplDocument (with shared=false) and then all subsequent
> ReplDocument instances I would create from it with the proposed copy
> constructor.
It seems like it shoudl work for your application to create and hold
on to:
Language language = Language.getDefaultLanguage();
// or whatever.
Environment environment = Environment.getCurrent();
Then when you create a new ReplDocument you do:
new ReplDocument(language, environment, true)
I.e. always set shared.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
More information about the Kawa
mailing list