[Larceny-users] Ken: what was the goal of your original experiments with process ?
Ken Dickey
Ken.Dickey at whidbey.com
Tue Jun 24 18:38:35 EDT 2008
Felix,
I was trying to get code up for GUI-Toy, with a simple SDL [Simple
Direct-media Layer] server process. It already works with Ikarus and Chez.
As a step in this direction, I went to get it up on PSTk [
http://t3x.org/pstk/ ].
Given the statement in "Standard/unix.scm", I tried the Chez code, but died
with an error message that said write-char could not write to the
output-port. [Will has since refined the error message].
Since Will let me know process returns binary ports, I was able to do the
simple code for PSTk:
[Code to add to "pstk.scm" for Larceny]
vvv------------------------------------------------------------------------vvv
;;LARCENY
(requirement (require "Standard/unix"))
(run-program
(lambda (program)
(let* ( (in/out/pid (process
(string-append "/bin/sh -c \"exec "
program
" 2>&1\"")))
(in (car in/out/pid))
(out (cadr in/out/pid))
(utf8-transcoder (make-transcoder (utf-8-codec)))
)
(list (transcoded-port in utf8-transcoder)
(transcoded-port out utf8-transcoder)))))
(bottom (lambda (x) x))
^^^------------------------------------------------------------------------^^^
So one can now play tick-tack-toe w Larceny...
I am now about to start the SDL-server port. I'll let you know if I have a
problem. [I don't really expect any, once I find the proper libs to load].
Thanks for taking a look at this.
Cheers,
-KenD
More information about the Larceny-users
mailing list