Welcome to the CHICKEN Scheme pasting service

filesystem walk added by mario-goulart on Tue Apr 27 23:06:01 2021

(import (chicken file)
        (chicken pathname))

(define (walk dir)
  (cond
   ((null? dir)
    '())
   ((string? dir)
    (cond
     ((directory-exists? dir)
      (walk (map (lambda (file)
                   (make-pathname dir file))
                 (directory dir))))
     (else (list dir))))
   ((list? dir)
    (append
     (walk (car dir))
     (walk (cdr dir))))))

Your annotation:

Enter a new annotation:

Your nick:
The title of your paste:
Your paste (mandatory) :
What's the one-argument procedure to check if a list is empty?
Visually impaired? Let me spell it for you (wav file) download WAV