Re: Newb question about calling Scheme from Java
"Mike J. Bell" <[email protected]> Wed, 3 Sep 2008 06:17:28 -0400
| Newsgroups | gmane.comp.java.sisc.user |
|---|---|
| Message-ID | <[email protected]> |
--===============0068545222== Content-Type: multipart/alternative; boundary="----=_Part_22997_21506558.1220437048054" ------=_Part_22997_21506558.1220437048054 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline On Tue, Sep 2, 2008 at 5:12 PM, Scott G. Miller <[email protected]> wrote: > On Tue, Sep 2, 2008 at 2:15 PM, Mike J. Bell <[email protected]> wrote: > > > > > Context.execute(appContext, new SchemeCaller() { > > public Object execute(Interpreter interpreter) throws SchemeException > { > > Symbol symbol = new Symbol("foobar"); > > Value value = SchemeBoolean.TRUE; > > Symbol context = new Symbol("r5rs"); > > > > interpreter.define(symbol, value, context); > > interpreter.eval("...my scheme code..."); > > ... > > > Not sure this is your problem, but you want Symbol.get("foobar"), not > new Symbol. If you don't do this, the resulting Symbol is distinct > from any other in SISC, and won't match ordinary symbols in Scheme. > > Scott > Hrm, that didn't work. Changed new Symbol("...") to Symbol.get("..."), and my error message is still sisc.interpreter.SchemeException: ((message . "undefined variable 'foobar'.")) at sisc.interpreter.SchemeRuntimeException.promote ...Interpreter.interpret ...Interpreter.interpret ...Interpreter.eval ... The code in question is (max-stack-trace-depth 16) (begin (display (+ 1 2)) (newline) (display foobar) (newline)) ;; (fairly innocuous!) ;; (and I really am trying to bind #t to 'foobar) Am I just totally off base with this? Thanks again... -- Mike J. Bell on gmail ------=_Part_22997_21506558.1220437048054 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Disposition: inline <div dir="ltr">On Tue, Sep 2, 2008 at 5:12 PM, Scott G. Miller <span dir="ltr"><<a href="mailto:[email protected]">[email protected]</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> <div class="Ih2E3d">On Tue, Sep 2, 2008 at 2:15 PM, Mike J. Bell <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br> <br> ><br> > Context.execute(appContext, new SchemeCaller() {<br> > public Object execute(Interpreter interpreter) throws SchemeException {<br> > Symbol symbol = new Symbol("foobar");<br> > Value value = SchemeBoolean.TRUE;<br> > Symbol context = new Symbol("r5rs");<br> ><br> > interpreter.define(symbol, value, context);<br> > interpreter.eval("...my scheme code...");<br> > ...<br> ><br> </div>Not sure this is your problem, but you want Symbol.get("foobar"), not<br> new Symbol. If you don't do this, the resulting Symbol is distinct<br> from any other in SISC, and won't match ordinary symbols in Scheme.<br> <font color="#888888"><br> Scott<br> </font></blockquote></div><br>Hrm, that didn't work. Changed new Symbol("...") to Symbol.get("..."), and my error message is still<br><br>sisc.interpreter.SchemeException: ((message . "undefined variable 'foobar'."))<br> at sisc.interpreter.SchemeRuntimeException.promote<br>...Interpreter.interpret<br>...Interpreter.interpret<br>...Interpreter.eval<br>...<br><br>The code in question is<br><br>(max-stack-trace-depth 16)<br><br>(begin<br> (display (+ 1 2))<br> (newline)<br> (display foobar)<br> (newline))<br><br>;; (fairly innocuous!)<br>;; (and I really am trying to bind #t to 'foobar)<br><br>Am I just totally off base with this? Thanks again...<br clear="all"><br>-- <br> Mike J. Bell on gmail<br> </div> ------=_Part_22997_21506558.1220437048054-- --===============0068545222== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ --===============0068545222== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Sisc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/sisc-users --===============0068545222==--