7 Apr 2008 17:53
Re: Converting scheme48 to a socket repl problem
Michael Sperber <sperber <at> deinprogramm.de>
2008-04-07 15:53:52 GMT
2008-04-07 15:53:52 GMT
Andrew Lentvorski <bsder <at> allcaps.org> writes:
> [running Scheme 48 off a socket]
I've had another look at this: I don't know what you're trying to do
exactly, but if you apply the attached patch (nothing fancy; just makes
the `usual-commands' package visible, rebuild via "make image", and do
this:
,open command-processor package-commands-internal big-sockets i/o
(define (repl)
((new-command-processor "Hello! Don't eat that yellow snow!"
(get-structure 'usual-commands)
(get-structure 'built-in-structures)
(get-structure 'more-structures))
'()))
(define (scheme-server)
(let ((socket (open-socket 8888)))
(call-with-values
(lambda ()
(socket-accept socket))
(lambda (in out)
(with-current-ports
in out out
repl)))))
... you get a one-off server you can connect to which will give you a
(Continue reading)
RSS Feed