More "~n" -> "\n" changes

original commit: 8e0f8dd39c3744472b450021f003f9cbe8cbcb62
This commit is contained in:
Eli Barzilay 2010-08-26 12:10:48 -04:00
parent 8ab581cf2e
commit 48b7074752
10 changed files with 14 additions and 14 deletions

View File

@ -10,14 +10,14 @@
(let aux ([tests tests]
[num-passed 0])
(if (null? tests)
(printf "~a tests passed.~n" num-passed)
(printf "~a tests passed.\n" num-passed)
(let ((test (car tests)))
(let ((actual ((car test)))
(expected (cadr test))
(msg (caddr test)))
(if (equal? actual expected)
(aux (cdr tests) (+ num-passed 1))
(printf "Test failed: ~a. Expected ~a, got ~a.~n"
(printf "Test failed: ~a. Expected ~a, got ~a.\n"
msg expected actual)))))))
(apply check-all tests) ; Works in untyped, but not in typed

View File

@ -39,7 +39,7 @@
;; add a single type to the mapping
;; identifier type -> void
(define (register-type/undefined id type)
;(printf "register-type/undef ~a~n" (syntax-e id))
;(printf "register-type/undef ~a\n" (syntax-e id))
(if (free-id-table-ref the-mapping id (lambda _ #f))
(void (tc-error/expr #:stx id "Duplicate type annotation for ~a" (syntax-e id)))
(free-id-table-set! the-mapping id (box type))))

View File

@ -27,7 +27,7 @@
;; add a name to the mapping
;; identifier type-stx -> void
(define (register-type-alias id stx)
;(printf "registering type ~a~n~a~n" (syntax-e id) id)
;(printf "registering type ~a\n~a\n" (syntax-e id) id)
(mapping-put! id (make-unresolved stx #f)))
(define (register-resolved-type-alias id ty)

View File

@ -24,7 +24,7 @@
;; add a name to the mapping
;; identifier Type -> void
(define (register-type-name id [type #t])
;(printf "registering type ~a~n~a~n" (syntax-e id) id)
;(printf "registering type ~a\n~a\n" (syntax-e id) id)
(mapping-put! id type))
;; add a bunch of names to the mapping

View File

@ -525,7 +525,7 @@
(match v
[(c S X T)
(let ([var (hash-ref h (or variable X) Constant)])
;(printf "variance was: ~a~nR was ~a~nX was ~a~nS T ~a ~a~n" var R (or variable X) S T)
;(printf "variance was: ~a\nR was ~a\nX was ~a\nS T ~a ~a\n" var R (or variable X) S T)
(evcase var
[Constant S]
[Covariant S]

View File

@ -94,7 +94,7 @@
"\n"))
(tc-error/expr #:return (ret (Un))
(string-append
"Polymorphic " fcn-string " could not be applied to arguments:~n"
"Polymorphic " fcn-string " could not be applied to arguments:\n"
(domain-mismatches t msg-doms msg-rests msg-drests msg-rngs argtypes #f #f #:expected expected)
(if (not (for/and ([t (apply append (map fv/list msg-doms))]) (memq t msg-vars)))
(string-append "Type Variables: " (stringify msg-vars) "\n")
@ -113,7 +113,7 @@
"\n"))
(tc-error/expr #:return (ret (Un))
(string-append
"Polymorphic " fcn-string " could not be applied to arguments:~n"
"Polymorphic " fcn-string " could not be applied to arguments:\n"
(domain-mismatches t msg-doms msg-rests msg-drests msg-rngs argtypes #f #f #:expected expected)
(if (not (for/and ([t (apply append (map fv/list msg-doms))]) (memq t msg-vars)))
(string-append "Type Variables: " (stringify msg-vars) "\n")

View File

@ -251,7 +251,7 @@
ns))]
[ty (extend-tvars tvars
(maybe-loop form formals bodies (ret expected*)))])
;(printf "plambda: ~a ~a ~a ~n" literal-tvars new-tvars ty)
;(printf "plambda: ~a ~a ~a \n" literal-tvars new-tvars ty)
t)]
[(tc-result1: (and t (PolyDots-names: (list ns ... dvar) expected*)))
(let-values
@ -278,7 +278,7 @@
[tvars
(let* ([ty (extend-tvars tvars
(tc/mono-lambda/type formals bodies #f))])
;(printf "plambda: ~a ~a ~a ~n" literal-tvars new-tvars ty)
;(printf "plambda: ~a ~a ~a \n" literal-tvars new-tvars ty)
(make-Poly tvars ty))])]
[(tc-result1: t)
(unless (check-below (tc/plambda form formals bodies #f) t)

View File

@ -187,7 +187,7 @@
#;[(Poly-unsafe: n b) (fp "(unsafe-poly ~a ~a ~a)" (Type-seq c) n b)]
[(Poly-names: names body)
#;(fprintf (current-error-port) "POLY SEQ: ~a~n" (Type-seq body))
#;(fprintf (current-error-port) "POLY SEQ: ~a\n" (Type-seq body))
(fp "(All ~a ~a)" names body)]
#;[(PolyDots-unsafe: n b) (fp "(unsafe-polydots ~a ~a ~a)" (Type-seq c) n b)]
[(PolyDots-names: (list names ... dotted) body)

View File

@ -378,7 +378,7 @@
[((Hashtable: _ _) (HashtableTop:)) A0]
;; subtyping on structs follows the declared hierarchy
[((Struct: nm (? Type? parent) flds proc _ _ _ _) other)
;(printf "subtype - hierarchy : ~a ~a ~a~n" nm parent other)
;(printf "subtype - hierarchy : ~a ~a ~a\n" nm parent other)
(subtype* A0 parent other)]
;; Promises are covariant
[((Struct: (== promise-sym) _ (list t) _ _ _ _ _) (Struct: (== promise-sym) _ (list t*) _ _ _ _ _)) (subtype* A0 t t*)]

View File

@ -115,7 +115,7 @@ at least theoretically.
(when (last-time)
(error #f "Timing already started"))
(last-time (current-process-milliseconds))
(printf "Starting ~a at ~a~n" msg (last-time)))])
(printf "Starting ~a at ~a\n" msg (last-time)))])
(syntax-rules ()
[(_ msg)
(begin
@ -125,7 +125,7 @@ at least theoretically.
[old (last-time)]
[diff (- t old)])
(last-time t)
(printf "Timing ~a at ~a@~a~n" msg diff t)))]))
(printf "Timing ~a at ~a@~a\n" msg diff t)))]))
(values (lambda _ #'(void)) (lambda _ #'(void)))))
;; custom printing