improve debug

pull/9/head
Matthew Butterick 11 years ago
parent 2333b0b0f7
commit 4e61ad85a5

@ -26,14 +26,17 @@
(define (make-date-string) (define (make-date-string)
(define date (current-date)) (define date (current-date))
(define date-fields (map (λ(x) (zero-fill x 2)) (list (define date-fields (map (λ(x) (zero-fill x 2))
(date-day date) (list
(list-ref months (sub1 (date-month date))) (date-day date)
(modulo (date-hour date) 12) (list-ref months (sub1 (date-month date)))
(date-minute date) (if (<= (date-hour date) 12)
(date-second date) (date-hour date) ; am hours + noon hour
; (if (< (date-hour date) 12) "am" "pm") (modulo (date-hour date) 12)) ; pm hours after noon hour
))) (date-minute date)
(date-second date)
; (if (< (date-hour date) 12) "am" "pm")
)))
(apply format "[~a-~a ~a:~a:~a]" date-fields)) (apply format "[~a-~a ~a:~a:~a]" date-fields))
(displayln (string-join `(,(make-date-string) ,@(map (λ(x)(if (string? x) x (~v x))) items))) (current-error-port))) (displayln (string-join `(,(make-date-string) ,@(map (λ(x)(if (string? x) x (~v x))) items))) (current-error-port)))

Loading…
Cancel
Save