ZHAO Wei wrote:
-----------------------------------------
#! /usr/bin/scsh \
-o threads -e main -s
!#
(define (display-line string)
(display string) (newline))
(define (delay-work work)
(spawn (lambda ()
(display-line "will do work after 3 seconds") (sleep 3000)
(work))))
(define (trouble)
(display-line "enter troubled work")
To be more specific, the script appears to hang right between these lines.
zw
(run (begin (display-line "This won't appear the second time")))
(run (| (begin (display-line "XXX"))
(nc localhost 8888))))
(define (main ignore)
(delay-work trouble)
(let ((watcher (lambda ()
(awk (read-line) (line) ()
((: bos "XXX") (delay-work trouble))))))
(let lp ()
(run (| (nc -l -p 8888)
(begin (watcher))))
(lp))))
----------------------------------
--
zhaoway@public1.ptt.js.cn
http://c2.com/cgi/wiki?ZhaoWay
http://advogato.org/person/zhaoway/
linux.ext2fs.tcp.ip.netfilter.gnu.debian.dpkg.rpm.bash.lex
yacc.gcc.lisp.scheme.ocaml.latex.html.css.php.apache.mysql
|