[Openmcl-devel] Remote REPL

Sven Van Caekenberghe sven at beta9.be
Thu Jan 9 07:42:53 PST 2003


Was: RE: Faceless Background Server Behavior

> I was looking at 
> http://www.franz.com/support/tech_corner/telnetserver.lhtml
> and reading the code in l1-readloop[-lds].lisp and friends (hard ;-). 
> Maybe setting *terminal-io* to some socket stream and starting 
> (toplevel) could do it ? Probably very much oversimplified...
>
> When I find some more time, I will try something, and I will ask again 
> how to wire it to the openmcl toplevel.

So OK, lisp hacking is very addictive, I gave it a try:

http://homepage.mac.com/svc/remote-repl.lisp

This code kind of works: I could not figure out how to bind 
*terminal-io* thus no print functions work, break loops and toplevel 
commands are also absent, but hey you can evaluate lisp code. Anyway, 
it would be much nicer to use the real openmcl toplevel-loop. I had a 
look, but I think there must be people who can do this much quicker - 
it would take me too long to even understand the code....

What we need is the equivalent of the acl code:

(defun start-telnet-session (s from)
   (unwind-protect
       (catch 'end-telnet-session
         (let ((*in-telnet-session* t))
           (tpl:start-interactive-top-level
            s 'tpl:top-level-read-eval-print-loop nil)))
     (ignore-errors (close s)))
   (format t "telnet server: closing connection from ~a~%" from))

In particular starting another toplevel loop (I hope that having 
multiple toplevel loops is different processes possible, otherwise the 
server could be made single threaded).

Sven

--
Sven Van Caekenberghe - mailto:sven at beta9.be
Beta Nine - software engineering - http://www.beta9.be
.Mac - svc at mac.com - http://homepage.mac.com/svc


_______________________________________________
Openmcl-devel mailing list
Openmcl-devel at clozure.com
http://clozure.com/cgi-bin/mailman/listinfo/openmcl-devel



More information about the Openmcl-devel mailing list