From: Pascal J. B. <pj...@in...> - 2012-03-05 15:06:28
|
"sca...@on..." <sca...@on...> writes: > I'm new to CLISP and I'd like if someone can advise me. Meaning you've never used clisp, the Common Lisp implementation written in C (hence C lisp, clisp), before. Or meaning you've never used Common Lisp, the programming language before? There are a lot of Common Lisp implementations, clisp is just one of them. Go to http://cliki.net/ for more pointers about Common Lisp. > I'm trying to put a java interface to a lisp application. This lisp > application is compatible with CLISP, so I've made a mem image and > load some cl files and can call some functions and works fine. My > problem is that I need to create an interfaz with Java but I don't > know how to do it. Nonetheless, it may be conforming or largely conforming, so you should not have much problem to make it run with another CL implementation. > The lisp code is an AI application called Babylon developed in 90's > and I need to put some interface with Java. Because the application > works fine in CLISP, I'd like to do a Java application, and If I do > some call to a function, the response from the console appears in Java > and if I need to send some parameters, that this parameter appears in > the console. > > I don't if there are some application, interface or function to call > the lisp console from webservices and the webservices try to call it > from Java. I need advice. Well, that sounds rather like a Java question. I suppose it's possible in Java to fork a program (whatever language it's written in!), and to send lines to it and read responses from it. In C you'd do that with pipe, dup, fork and exec. With clisp you'd do that using EXT:MAKE-PIPE-IO-STREAM http://www.clisp.org/impnotes/shell.html I guess something similar exists in Java? But consider ABCL instead of clisp. It'll be much easier to integrate Java with Lisp using ABCL. With clisp, the best you can do is to provide a tcp/ip or unix socket server on one side and a connect to it on the other side, implementing some kind of protocol to communicate between the Java program and the Lisp program (or using the REPL with a pair of pipes like above). -- __Pascal Bourguignon__ http://www.informatimago.com/ A bad day in () is better than a good day in {}. |