tests/read-forms.lisp (517 bytes)
1 ;; Read every form in the file named on the command line. Exit 1 on a read error. 2 ;; *read-suppress* makes the reader check syntax only: it does not intern 3 ;; symbols in packages that do not exist and does not evaluate #. forms. 4 (let ((path (second sb-ext:*posix-argv*)) 5 (*read-suppress* t)) 6 (handler-case 7 (with-open-file (in path) 8 (loop for form = (read in nil in) 9 until (eq form in))) 10 (error (e) 11 (format *error-output* "~a: ~a~%" path e) 12 (sb-ext:exit :code 1))))