Welcome to the CHICKEN Scheme pasting service

read-lines/write-lines added by wasamasa on Tue Jul 13 09:12:37 2021

(import scheme)
(import (chicken base))
(import (chicken io))

(define (read-lines path)
  (call-with-input-file path
    (lambda (in)
      (read-list in read-line))))

(define (write-lines path lines)
  (call-with-output-file path
    (lambda (out)
      (for-each
       (lambda (line)
         (write-line line out))
       lines))))

(let ((lines (read-lines "/etc/passwd")))
  (write-lines "/tmp/lines" lines))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What type of object does `map' expect as second argument?
Visually impaired? Let me spell it for you (wav file) download WAV