commit 3a90ac28b5aeb621d484637aa81519327a0342f9 Author: Tomas Hlavaty <tom@logand.com> Date: Sat, 19 Feb 2011 01:42:06 +0100 initial commit Diffstat:
A | swank-picolisp.l | | | 30 | ++++++++++++++++++++++++++++++ |
1 file changed, 30 insertions(+), 0 deletions(-)
diff --git a/swank-picolisp.l b/swank-picolisp.l @@ -0,0 +1,30 @@ +# -*- picolisp -*- + +## (de start-swank (PortFile) +## (if (num? PortFile) +## (print "Listening on port " PortFile) +## (print "Talking via file " PortFile) ) ) + +(de swank (Port) + (default Port 4005) + (accept-connections Port NIL) ) + +(de start-swank (PortFile) + (accept-connections NIL PortFile) ) + +(de accept-connections (Port PortFile) + (let P (port (or Port 0) 'Port) + (prinl "## Listening on port " Port) + (when PortFile + (out @ (prinl Port)) ) + (use Sock + (loop + (setq Sock (listen P)) + (serve Sock) + (close Sock) ) ) ) ) + +(de serve (Sock) + (println Sock) + (flush) + (println (in Sock (line)) ) + (flush) )