From: Moritz Heidkamp <[email protected]> Subject: [Chicken-hackers] Suggestion for the ports unit: port-pipe Date: Mon, 09 Aug 2010 04:02:19 +0200
> Dear Chickenados, > > I frequently find myself wanting/implementing a procedure which I shall > call `port-pipe'. As the name suggests, its purpose is piping data from > one port to another. As I find it very handy and general-purposey, I > propose it for inclusion in the ports unit. Without further ado, here is > the procedure: > > (define (port-pipe #!key (from (current-input-port)) (to > (current-output-port)) (read read-char) (write write-char)) > (with-output-to-port to > (lambda () > (with-input-from-port from > (lambda () > (port-for-each write read)))))) > I'd call it `port-copy'. cheers, felix _______________________________________________ Chicken-hackers mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/chicken-hackers
