+
+(define (eval-from-client rec-channel send-channel)
+ (cond ((char-ready? rec-channel)
+ (catch #t
+ (lambda ()
+ (let ((exp (read rec-channel)))
+ (cond ((eof-object? exp)
+ (close rec-channel))
+ (else
+ (write (format #f "~a" (eval-string exp)) send-channel)))))
+ (lambda (key . args)
+ (let ((fmt (string-concatenate (list (cadr args) "~%")))
+ (params (caddr args)))
+ (write
+ (if params
+ (apply format (cons #f (cons fmt params)))
+ (format #f fmt))
+ send-channel))))
+ (force-output send-channel))))