[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] Help with usage of process ...

From: Matt Welland
Subject: Re: [Chicken-users] Help with usage of process ...
Date: Sat, 10 Oct 2015 21:03:22 -0700

On Fri, Oct 9, 2015 at 7:25 PM, Evan Hanson <address@hidden> wrote:
Hi Matt,

My guess is that because you don't close the output port before waiting
for results, dot(1) sits there waiting for more input and your procedure
appears to hang.

Ah, yes, dot is not processing the input until it is read in its entirety. Thanks Evan. The following works fine:

(define (tests:run-dot indat outtype) ;; outtype is plain, fig, dot, etc.
  (let-values (((inp oup pid)(process "dot" (list "-T" outtype))))
    (with-output-to-port oup
      (lambda ()
    (map print indat)))
    (close-output-port oup)
    (let ((res (with-input-from-port inp
         (lambda ()
      (close-input-port inp)

I'd try closing `oup` once you've written your graph to the process, for
example by making the thunk you use for the "dot writer" thread look like:

    (lambda ()
      (with-output-to-port oup
       (lambda ()
         (map print indat)
         (close-output-port oup))))



Chicken-users mailing list

reply via email to

[Prev in Thread] Current Thread [Next in Thread]