Welcome to the CHICKEN Scheme pasting service

Using posix' process procedure pasted by wasamasa on Fri Mar 25 10:02:33 2016

(use posix utils)

(define (call-process-string command input)
  (receive
   (i o pid)
   (process command '())
   (display input o)
   (close-output-port o)
   (read-all i)
   (close-input-port i)))

;; this hangs
(call-process-string "tac" "foo\nbar\nbaz\n")

Fixed version added by wasamasa on Fri Mar 25 10:05:21 2016

(use posix utils)

(define (call-process-string command input)
  (receive
   (i o pid)
   (process command '())
   (display input o)
   (close-output-port o)
   (let ((output (read-all i)))
     (close-input-port i)
     output)))

(call-process-string "tac" "foo\nbar\nbaz\n")

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What does `(string? "foo")' produce?
Visually impaired? Let me spell it for you (wav file) download WAV