Created
October 19, 2017 01:26
-
-
Save pnwamk/02ce911d8a28e32a29bfc621c5c2f273 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; read from p, return a funny symbol if it fails for some reason | |
(define (try-read p) | |
(with-handlers ([(λ _ #t) (λ (_) 'READ-ERROR-ENCOUNTERED)]) | |
(read p))) | |
;; for each racket source file, look for usages of "sort" | |
(for ([p (in-directory dir)] | |
#:when (regexp-match? #rx"\\.rkt" (path->string p))) | |
(define file (open-input-file p)) | |
(set! files (add1 files)) | |
(let loop! ([next (try-read file)]) | |
(search-sexp! next) | |
(when (not (eof-object? next)) | |
(loop! (try-read file)))) | |
(close-input-port file)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment