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