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

From: Robby Findler (robby at cs.uchicago.edu)
Date: Thu Dec 20 14:20:47 EST 2007

On Dec 20, 2007 1:18 PM, Jens Axel Soegaard <jensaxel at soegaard.net> wrote:
> Matthew Flatt skrev:
> > 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.
> A little simpler just to embed the filename in the shell command :-)

I'd argue that that's more complex. You have the saving issues, not to
mention that there isn't always a filename.

> >> 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.
> But perhaps not so involved as would could fear.

That's the spirit! :)


Posted on the users mailing list.