bf-loop nits

pull/10/head
Matthew Butterick 8 years ago
parent f25679622a
commit 50eb4964cd

@ -20,8 +20,7 @@
(define (print-line output-filename cells) (define (print-line output-filename cells)
(with-output-to-file output-filename (with-output-to-file output-filename
(λ () (printf (format "~a\n" (string-join cells "|" #:before-first "|" #:after-last "|")))) (λ () (printf (format "~a\n" (string-join cells "|" #:before-first "|" #:after-last "|"))))
#:mode 'text #:mode 'text #:exists 'append))
#:exists 'append))
(module+ test (module+ test
(require rackunit) (require rackunit)
@ -44,8 +43,7 @@
(define-macro (tst-load-expr CHIPFILE-STRING) (define-macro (tst-load-expr CHIPFILE-STRING)
(set! chip-prefix (string-replace (syntax->datum #'CHIPFILE-STRING) ".hdl" "")) (set! chip-prefix (string-replace (syntax->datum #'CHIPFILE-STRING) ".hdl" ""))
(with-pattern (with-pattern ([CHIPFILE.RKT (format-string "~a.rkt" #'CHIPFILE-STRING)])
([CHIPFILE.RKT (format-string "~a.rkt" #'CHIPFILE-STRING)])
#'(require CHIPFILE.RKT))) #'(require CHIPFILE.RKT)))
@ -53,10 +51,8 @@
(with-shared-id (output-file output-filename) (with-shared-id (output-file output-filename)
#'(begin #'(begin
(define output-filename OUTPUT-FILE-STRING) (define output-filename OUTPUT-FILE-STRING)
(with-output-to-file output-filename (with-output-to-file output-filename (λ () (printf ""))
(λ () (printf "")) #:mode 'text #:exists 'replace))))
#:mode 'text
#:exists 'replace))))
(define-macro (tst-compare-to-expr COMPARE-FILE-STRING) (define-macro (tst-compare-to-expr COMPARE-FILE-STRING)
@ -67,8 +63,7 @@
(define-macro (tst-output-list-expr (COL-NAME FORMAT-SPEC) ...) (define-macro (tst-output-list-expr (COL-NAME FORMAT-SPEC) ...)
(with-shared-id (eval-result eval-chip output output-filename) (with-shared-id (eval-result eval-chip output output-filename)
(with-pattern (with-pattern ([(COL-ID ...) (suffix-ids #'(COL-NAME ...) "")]
([(COL-ID ...) (suffix-ids #'(COL-NAME ...))]
[(CHIP-COL-ID ...) (prefix-ids chip-prefix "-" #'(COL-NAME ...))]) [(CHIP-COL-ID ...) (prefix-ids chip-prefix "-" #'(COL-NAME ...))])
#'(begin #'(begin
(define (output COL-ID ...) (define (output COL-ID ...)

Loading…
Cancel
Save