Welcome to the CHICKEN Scheme pasting service

pipes.scm added by gahr on Wed May 29 08:36:48 2024

(import (scheme) (chicken base) (chicken file posix) (chicken process))
(let-values (((p c ) (create-pipe)))
  (define (child)
    (let ((out (open-output-file* c))
          (in  (open-input-file* c)))
      (let ((r (read in)))
        (print "child: got " r)
        (write "pong" out)
        (flush-output out)  )))

  (let ((pid (process-fork child #t)))
    (if (eq? pid 0)
      (exit)
      (begin
        (let ((out (open-output-file* p))
              (in  (open-input-file* p)))
          (write "ping" out)
          (flush-output out)
          (let ((r (read in)))
            (print "parent: got " r)))))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
Which egg provides `string-pad-right'?
Visually impaired? Let me spell it for you (wav file) download WAV