Find Racket files
#lang racket ;; Finds Racket sources in all subdirs (for ([path (in-directory)] #:when (regexp-match? #rx"[.]rkt$" path)) (printf "source file: ~a\n" path))
The in-directory function constructs a sequence that walks a directory tree (starting with the current directory, by default) and generates paths in the tree. The for form binds path to each path in the sequence, and regexp-match? applies a pattern to the path.
To run the example, install Racket, start DrRacket, paste the example program into the top area in DrRacket, and click the Run button. Alternatively, save the program to a file and run racket on the file.
Form and function names in the code are hyperlinked to documentation, so click on them for more information.