[plt-scheme] Noticeable absence of (with-output-to-port ...) and (with-input-from-port ...)

From: Ernie Smith (esmith at acanac.net)
Date: Thu Sep 11 09:36:30 EDT 2008

I was looking to redirect intput and output of existing
scheme functions to pipes.

In the spirit of  "The art of taking out the weakness that  causes the  
need to add features" 
(forgive the paraphrase, I couldn't find the original quote),  I am
surprised to find that  though (with-output-to-file ...) is defined,
the more general (with-output-to-port ...)  appears to be lacking. 
It would seem to me that  (with-output-to-port ...) would make other
(with-output-to-xxx ...) unnecessary, but the the converse is not true,
so I surmise there is an underlying implementation problem or a conflict
 with a more substantial issue. Perhaps someone could edify me on this.
Why is it missing?

Back to my initial problem:  (with-input-from-port ...) and
(with-output-to-port ...)  exemplify exactly what I am looking for,
where I could make a pipe and invoke them  as follows
(with-output-to-port port1 (with-input-from-port port2 ...))
in one context,  and use file streamss in another context etc..

Given I dont have that, can someone suggest how I should proceed instead?










Posted on the users mailing list.