[plt-scheme] The filename of the file in the definition window

From: Matthew Flatt (mflatt at cs.utah.edu)
Date: Wed Dec 19 17:15:05 EST 2007

At Wed, 19 Dec 2007 16:09:42 -0600, "Robby Findler" wrote:
> > Well, I as described above I actually want to call the external
> > tool via "system" from (lib "process.ss"), so I can't pass
> > the port along.
> 
> Sure you can! (Well, "pass" was the wrong word but the idea is right.)
> 
> Check out (lib "port.ss"). You can to create a thread that does a
> copy-port from the port you've got there to the input port you get
> from the process call. You'll need a pipe inbetween.
> 
> Be sure to close your ports (the pipe ones too).

Avoid creating pipes, because it creates too much work for you in
managing a concurrent copy operation and closing the pipe at the right
time. Instead, parameterize the call to `system' to set
`current-input-port' to your port.

Matthew



Posted on the users mailing list.