From: Timothy J. H. <tim...@ma...> - 2004-05-22 13:24:52
|
On May 22, 2004, at 8:47 AM, matthew grisius wrote: > Hi Tim, > > I would like to have multiple REPLs each with their own input, output, > and error, yet share an Evaluator 'context'. In effect separating the > R and the P from the E. Should or could this be accomplished by having > separate instances of a jsint.Evaluator and then share the > 'environment' between them? Would that be the 'correct way'? Thanks, > any help would be appreciated. You can do this by creating two JScheme instances js1 and js2 and then manually replacing the dynamic environment of the evaluator in js2 by that in js1 (define js1 (jscheme.JScheme.)) (define js2 (jscheme.JScheme.))) (define ev1 (.getEvaluator js1)) (define ev2 (.getEvaluator js2)) (.INTERACTION_ENVIRONMENT$ ev2 (.INTERACTION_ENVIRONMENT$ ev1)) How would you be interested in using such a pair of instances? ---Tim--- > > -matt grisius > > > On May 19, 2004, at 12:56 AM, Timothy John Hickey wrote: > >> The jscheme.JS class has been modified so that it allows multiple >> Independent JScheme >> instances. This requires a change to the way the JS class is used to >> call Scheme from Java. >> Many thanks to Toby Allsopp for this extension! >> >> Previously, JS defined static methods for evaluating expressions and >> calling procedures. >> All of those methods are now instance methods and you first need to >> construct an instance: >> >> JS js = new JS(); >> js.load(new java.io.File("app.init")); >> js.call("describe", this); >> ... >> or from Scheme >> (define js (jscheme.JS.)) >> (.eval js '(define z 5)) >> (.eval js '(+ z 1)) >> >> See the javadoc for jscheme.JS for more examples.... >> >> This should make it easier to build JScheme plugins for Eclipse and >> other IDEs >> >> If you run into any problems, please tell us right away so we can fix >> any bugs >> that may have been introduced by this fairly major change. >> >> Cheers, >> ---Tim--- >> >> >> >> ------------------------------------------------------- >> This SF.Net email is sponsored by: SourceForge.net Broadband >> Sign-up now for SourceForge Broadband and get the fastest >> 6.0/768 connection for only $19.95/mo for the first 3 months! >> http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click >> _______________________________________________ >> Jscheme-user mailing list >> Jsc...@li... >> https://lists.sourceforge.net/lists/listinfo/jscheme-user >> > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: Oracle 10g > Get certified on the hottest thing ever to hit the market... Oracle > 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. > http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click > _______________________________________________ > Jscheme-user mailing list > Jsc...@li... > https://lists.sourceforge.net/lists/listinfo/jscheme-user |