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

This commit is contained in:
Eli Barzilay 2010-08-26 12:10:48 -04:00
parent 2853020369
commit 8e0f8dd39c
155 changed files with 357 additions and 362 deletions

View File

@ -614,7 +614,7 @@
(loop)]
[msg
(fprintf (current-error-port)
"frtime engine: msg not understood: ~a~n"
"frtime engine: msg not understood: ~a\n"
msg)
(loop)]))

View File

@ -287,7 +287,7 @@
(if (<= input test)
'input-smaller
'test-smaller)))]))])
; (printf "~a ~a ~a~n" compare secs (date->string date))
; (printf "~a ~a ~a\n" compare secs (date->string date))
(cond
[(eq? compare 'equal) secs]
[(or (= secs below-secs) (= secs above-secs))

View File

@ -95,7 +95,7 @@
(label "Check3")))
; get the streams from the check boxes
(printf "callbacks->args-evts:~n")
(printf "callbacks->args-evts:\n")
(send my-cb1 get-focus-events)
(send my-cb2 get-focus-events)
(send my-cb3 get-focus-events)
@ -143,7 +143,7 @@
(map-e car es)))
(label "Check4")))
(printf "mixin-merge-e:~n")
(printf "mixin-merge-e:\n")
(send my-cb4 get-focus-events) ; focus-events
(send my-cb4 get-key-events) ; key-events

View File

@ -93,7 +93,7 @@
(lambda (e)
(fprintf
(current-error-port)
"you've encountered a bug in frtime. please send a report to the Racket mailing list.~nexn: ~a~n"
"you've encountered a bug in frtime. please send a report to the Racket mailing list.\nexn: ~a\n"
e) #f)))
(cond
[(memq obj mem) #f]

View File

@ -555,7 +555,7 @@
[proc-k (lambda (evt) (proc emit suspend evt) (set! proc-k #f))])
(let ([thunk (lambda ()
(when (ormap undefined? streams)
;(fprintf (current-error-port) "had an undefined stream~n")
;(fprintf (current-error-port) "had an undefined stream\n")
(set! streams (fix-streams streams args)))
(let loop ([streams streams])
(extract (lambda (the-event strs)
@ -658,7 +658,7 @@
rtn))))
(define (make-mutable lst)
(printf "make-mutable called on ~a~n" lst)
(printf "make-mutable called on ~a\n" lst)
lst
#;(if (pair? lst)
(mcons (first lst) (make-mutable (rest lst)))
@ -774,7 +774,7 @@
(syntax->list #'(exp ...)))])
#'(tag new-exp ...))]
[x (begin
(fprintf (current-error-port) "snapshot-unbound: fell through on ~a~n" #'x)
(fprintf (current-error-port) "snapshot-unbound: fell through on ~a\n" #'x)
'())])
expr insp #f))))
@ -793,7 +793,7 @@
[(free-var ...) (hash-map unbound-ids
(lambda (k v) k))])
(begin
;(printf "~a~n" unbound-ids)
;(printf "~a\n" unbound-ids)
#'(if (ormap behavior? (list free-var ...))
(procs->signal:compound (lambda _
(lambda (id ...)

View File

@ -47,7 +47,7 @@
;; from getting too big.
(set! cnt 0)
(set! search (mk-search)))
(printf "------------~n~a~n" (board->string depth board))
(printf "------------\n~a\n" (board->string depth board))
(cond
[(winner? board 'red) 0]
[(winner? board 'yellow)
@ -112,6 +112,6 @@
(hash-table-for-each move-map
(lambda (k v)
(when (> (list-ref v 3) 1)
(printf "~s~n" (cons k v)))))))
(printf "~s\n" (cons k v)))))))
CONFIG EXPLORE MODEL HEURISTICS)])
(export))))

View File

@ -92,7 +92,7 @@
0 ; indent
init-memory
me board)])
(log-printf 1 0 "> ~a/~a Result: ~a~n"
(log-printf 1 0 "> ~a/~a Result: ~a\n"
steps (min max-depth one-step-depth)
(play->string v))
v))
@ -471,7 +471,7 @@
(set! explore-count 0)
(set! enter-count 0)
(set! move-count 0)
(log-printf 1 indent "~a> ~a Exploring for ~a~n" (make-string indent #\space) steps me)
(log-printf 1 indent "~a> ~a Exploring for ~a\n" (make-string indent #\space) steps me)
(let-values ([(vs xform)
(minmax 0
(if (or (steps . <= . 1) first-move?)
@ -480,7 +480,7 @@
config
me
board #f #f)])
(log-printf 2 indent "~a>> Done ~a ~a ~a ~a+~a [~a secs]~n"
(log-printf 2 indent "~a>> Done ~a ~a ~a ~a+~a [~a secs]\n"
(make-string indent #\space)
hit-count depth-count explore-count enter-count move-count
(float->string (/ (- (current-inexact-milliseconds) now) 1000)))
@ -559,7 +559,7 @@
(with-output-to-file MEMORY-FILE
(lambda ()
(let ([m (cdar plays)])
(printf "(~a ~a ~a)~n#|~n~a|#~n"
(printf "(~a ~a ~a)\n#|\n~a|#\n"
(if (found-win? plays) 'win 'lose)
(car board-key+xform)
(list
@ -620,10 +620,10 @@
(define (show-recur sz from-i from-j to-i to-j sv)
(if (not (plan? (cdar sv)))
(printf " Recur ~a (~a,~a)->(~a,~a) ; ??? = ~a/~a~n"
(printf " Recur ~a (~a,~a)->(~a,~a) ; ??? = ~a/~a\n"
sz from-i from-j to-i to-j
(caar sv) (get-depth (car sv)))
(printf " Recur ~a (~a,~a)->(~a,~a) ; (~a,~a)->(~a,~a) = ~a/~a~n"
(printf " Recur ~a (~a,~a)->(~a,~a) ; (~a,~a)->(~a,~a) = ~a/~a\n"
sz from-i from-j to-i to-j
(plan-from-i (cdar sv)) (plan-from-j (cdar sv))
(plan-to-i (cdar sv)) (plan-to-j (cdar sv))

View File

@ -202,7 +202,7 @@
[three-red-board (move two-red-board (cadr red-pieces) #f #f 1 1 values void)])
(define (test x y)
(unless (equal? x y)
(error 'test "failure!: ~s ~s~n" x y)))
(error 'test "failure!: ~s ~s\n" x y)))
(test #f (n-in-a-row/col? 1 empty-board 0 0 'red))
(test #t (n-in-a-row/col? 1 one-red-board 0 0 'red))
(test #t (n-in-a-row/col? 2 two-red-board 0 0 'red))

View File

@ -57,13 +57,13 @@
[history null])
(cond
[(winner? board who)
(printf "----------- ~a wins!-------------~n~a~n" who (board->string 1 board))
(printf "----------- ~a wins!-------------\n~a\n" who (board->string 1 board))
(go)]
[(winner? board (other who))
(printf "----------- ~a wins!-------------~n~a~n" (other who) (board->string 1 board))
(printf "----------- ~a wins!-------------\n~a\n" (other who) (board->string 1 board))
(go)]
[else
(printf "~n~a moved; ~a's turn~n~a~n" who-moved who (board->string 1 board))
(printf "\n~a moved; ~a's turn\n~a\n" who-moved who (board->string 1 board))
(let ([start (current-inexact-milliseconds)]
[m ((make-search (if (= BOARD-SIZE 3)
make-3x3-rate-board
@ -73,7 +73,7 @@
make-4x4-canned-moves))
timeout steps depth
who board history)])
(printf "[~a secs]~n" (/ (- (current-inexact-milliseconds) start)
(printf "[~a secs]\n" (/ (- (current-inexact-milliseconds) start)
1000.0))
(loop (apply-play board m) (other who) who (cons board history)))])))))
CONFIG EXPLORE MODEL HEURISTICS)])

View File

@ -70,7 +70,7 @@
;; Time test
(let ([start (current-inexact-milliseconds)]
[m (test-search 5 empty-board 'red null)])
(printf "[~a secs]~n" (/ (- (current-inexact-milliseconds) start)
(printf "[~a secs]\n" (/ (- (current-inexact-milliseconds) start)
1000.0))
))
CONFIG EXPLORE MODEL HEURISTICS)])

View File

@ -18,10 +18,10 @@
(set-failed!)
(printf " EXPECTED ~s" ex)
(exit))
(printf "~n")))]))
(printf "\n")))]))
(define (report-test-results)
(printf (if failed?
"~nTESTS FAILED~n"
"~nAll tests passed.~n"))))
"\nTESTS FAILED\n"
"\nAll tests passed.\n"))))

View File

@ -134,7 +134,7 @@
[n choice])
(cond
[(zero? n)
;(printf "choose: ~a~n" (car choices))
;(printf "choose: ~a\n" (car choices))
(set! choice-coordinates (car choices))
(cdr choices)]
[else (cons (car choices) (loop (cdr choices) (- n 1)))])))

View File

@ -426,7 +426,7 @@ paint by numbers.
[(eq? prev WRONG-BRUSH) UNKNOWN-BRUSH]
[else
(error 'internal-error
"unkown brush in board ~s~n" prev)]))]
"unkown brush in board ~s\n" prev)]))]
[define/private check-modifier
(lambda (evt)
@ -741,7 +741,7 @@ paint by numbers.
(loop (- i 1) 0 ans)
(loop (- i 1) 0 (cons block-count ans)))]
[(on) (loop (- i 1) (+ block-count 1) ans)]
[else (error 'calculate-col "unknown response from get-rect: ~a~n" this)]))])))]
[else (error 'calculate-col "unknown response from get-rect: ~a\n" this)]))])))]
[define/private calculate-col
(lambda (col)
@ -762,7 +762,7 @@ paint by numbers.
(let loop ([l col/row-numbers]
[n col/row])
(cond
[(null? l) (error 'update-col/row "col/row too big: ~a~n" col/row)]
[(null? l) (error 'update-col/row "col/row too big: ~a\n" col/row)]
[(zero? n)
(cons (calculate-col/row col/row)
(cdr l))]

View File

@ -265,8 +265,8 @@
(fw:gui-utils:get-choice
(format "~
Solving can be a very computationally intense task;~
~nyou may run out of memory and crash. ~
~nReally continue? (Be sure to save your work!)")
\nyou may run out of memory and crash. ~
\nReally continue? (Be sure to save your work!)")
"Yes"
"No"
"Really Solve?"

View File

@ -278,8 +278,8 @@
(gui-utils:get-choice
(format "~
Solving can be a very computationally intense task;~
~nyou may run out of memory and crash. ~
~nReally continue? (Be sure to save your work!)")
\nyou may run out of memory and crash. ~
\nReally continue? (Be sure to save your work!)")
"Yes"
"No"
"Really Solve?"

View File

@ -17,7 +17,7 @@
(newline (current-error-port))))
(define (calculate-grid filename)
(fprintf (current-error-port) "reading ~a~n" filename)
(fprintf (current-error-port) "reading ~a\n" filename)
(let* ([bitmap (make-object bitmap% filename)]
[_ (unless (send bitmap ok?)
(error 'bad-bitmap "name: ~a" filename))]
@ -34,10 +34,10 @@
[new-bitmap-height (floor (/ (- puzzle-height 1) pixel-size))])
(begin
(fprintf (current-error-port) "size of picture: ~a x ~a~n" raw-width raw-height)
(fprintf (current-error-port) " size of image: ~a x ~a~n" image-width image-height)
(fprintf (current-error-port) "grid-start (~a, ~a)~n" grid-x-start grid-y-start)
(fprintf (current-error-port) "size of puzzle: ~a x ~a~n"
(fprintf (current-error-port) "size of picture: ~a x ~a\n" raw-width raw-height)
(fprintf (current-error-port) " size of image: ~a x ~a\n" image-width image-height)
(fprintf (current-error-port) "grid-start (~a, ~a)\n" grid-x-start grid-y-start)
(fprintf (current-error-port) "size of puzzle: ~a x ~a\n"
puzzle-width
puzzle-height))
(reverse
@ -62,7 +62,7 @@
(* pixel-size (+ j -1 1/2)))))
'x
'o)])
;(fprintf (current-error-port) "(~a, ~a) is ~a~n" i j pixel-value)
;(fprintf (current-error-port) "(~a, ~a) is ~a\n" i j pixel-value)
(cons pixel-value
(loop (- i 1))))])))
(loop (- j 1)))])))))
@ -162,7 +162,7 @@
(call-with-output-file "raw-hattori.ss"
(lambda (port)
(parameterize ([current-output-port port])
(printf "`(~n")
(printf "`(\n")
(let loop ([n 1])
(when (<= n 139)
(main-n n)

View File

@ -8,12 +8,12 @@
"expected an image file on the command-line"))
(define image (vector-ref argv 0))
(fprintf (current-error-port) "processing ~a~n" image)
(fprintf (current-error-port) "processing ~a\n" image)
(define bitmap (make-object bitmap% image))
(when (send bitmap is-color?)
(fprintf (current-error-port)
"expected a monochrome bitmap -- all non-black spaces will be considered white~n"))
"expected a monochrome bitmap -- all non-black spaces will be considered white\n"))
(newline (current-error-port))

View File

@ -28,8 +28,8 @@ The col and row type specs are in sig.ss and the solution type is:
(prefix solve: "../solve.ss"))
(if (equal? (vector) argv)
(printf "pass any command line argument to skip the solver~n~n")
(printf "skipping the solver~n"))
(printf "pass any command line argument to skip the solver\n\n")
(printf "skipping the solver\n"))
(define memory-limit (* 1024 1024 400)) ;; in bytes (500 megs)
@ -161,7 +161,7 @@ The col and row type specs are in sig.ss and the solution type is:
(newline)]
[else
(let ([dots-to-print (floor (- (* progress-bar-max (/ counter (- max 1))) dots-printed))])
'(printf "~spercentage: ~a ~a ~a ~a~n"
'(printf "~spercentage: ~a ~a ~a ~a\n"
cleanup
dots-to-print
counter
@ -184,7 +184,7 @@ The col and row type specs are in sig.ss and the solution type is:
(define (solve name rows cols)
(cond
[(equal? argv (vector))
(printf "Solving ~s; memory limit ~a~n"
(printf "Solving ~s; memory limit ~a\n"
name (format-memory-txt memory-limit))
(let ([row-count (length rows)]
[col-count (length cols)])
@ -205,7 +205,7 @@ The col and row type specs are in sig.ss and the solution type is:
(semaphore-wait kill)
(set! sucessful? #f)
(kill-thread k)
(fprintf (current-error-port) "~nsolver raised an exception~n~a~n"
(fprintf (current-error-port) "\nsolver raised an exception\n~a\n"
(if (exn? x)
(exn-message x)
x))
@ -235,7 +235,7 @@ The col and row type specs are in sig.ss and the solution type is:
(void))))))
(semaphore-wait kill)
(kill-thread t)
(fprintf (current-error-port) "~n memory limit expired.~n")
(fprintf (current-error-port) "\n memory limit expired.\n")
(collect-garbage)(collect-garbage)(collect-garbage)(collect-garbage)(collect-garbage)
(update-memory-display)
(semaphore-post done)))])
@ -271,10 +271,10 @@ The col and row type specs are in sig.ss and the solution type is:
[problems (caddr set)])
(for-each sanity-check problems)
(if (file-exists? output-file)
(printf "skipping ~s (~a)~n" set-name (normalize-path output-file))
(printf "skipping ~s (~a)\n" set-name (normalize-path output-file))
(call-with-output-file output-file
(lambda (port)
(printf "Building ~s~n" set-name)
(printf "Building ~s\n" set-name)
(parameterize ([current-output-port port])
(write
`(unit/sig paint-by-numbers:problem-set^

View File

@ -559,7 +559,7 @@
((unknown) ".")
((on) "#"))))
row)
(printf "~n"))
(printf "\n"))
(extract-rows board)))
; animate-changes takes a board and draws it on the main screen

View File

@ -70,7 +70,7 @@
'(when (= depth 2)
(fprintf (current-error-port)
"us: ~a them: ~a u-m:~a t-m: ~a u-l: ~a t-l: ~a u-c: ~a t-c: ~a~n"
"us: ~a them: ~a u-m:~a t-m: ~a u-l: ~a t-l: ~a u-c: ~a t-c: ~a\n"
usses thems
middle-usses middle-thems
us-in-line them-in-line

View File

@ -290,9 +290,9 @@
(format
(string-append
"There was an error running the "
"program player for ~a.~n"
"We'll assume a default move, T1.~n"
"Here is the error message:~n~a")
"program player for ~a.\n"
"We'll assume a default move, T1.\n"
"Here is the error message:\n~a")
who
(if (exn? exn)
(exn-message exn)
@ -685,7 +685,7 @@
(with-handlers ([void
(lambda (exn)
(message-box "Error"
(format "There was an error:~n~a"
(format "There was an error:\n~a"
(if (exn? exn)
(exn-message exn)
exn))))])

View File

@ -125,7 +125,7 @@
(- (car gf) good-so-far))])
'(when (and (= depth RECURSION-DEPTH))
(fprintf (current-error-port) "Returned goodness: ~a~n" (car move))
(fprintf (current-error-port) "Returned goodness: ~a\n" (car move))
(print-board (cadr gf) (current-error-port)))
(let ([g (car move)])
@ -153,7 +153,7 @@
'(when (and (= depth RECURSION-DEPTH))
(for-each (lambda (gf)
(fprintf (current-error-port) "Goodness: ~a~n" (car gf))
(fprintf (current-error-port) "Goodness: ~a\n" (car gf))
(print-board (cadr gf) (current-error-port)))
good-futures))
@ -263,9 +263,9 @@
(thread
(lambda ()
(let loop ([iteration 0])
; (fprintf (current-error-port) "Starting iteration ~a~n" iteration)
; (fprintf (current-error-port) "Starting iteration ~a\n" iteration)
(set! result (f iteration))
'(fprintf (current-error-port) " [finished iteration depth ~a: ~a~a]~n"
'(fprintf (current-error-port) " [finished iteration depth ~a: ~a~a]\n"
iteration (cadr result) (add1 (cddr result)))
(unless (or (pair? (car result)))
(loop (add1 iteration)))))))
@ -282,7 +282,7 @@
(define (go)
'(begin
(fprintf (current-error-port) "Start:~n")
(fprintf (current-error-port) "Start:\n")
(print-board board (current-error-port)))
(let* ([go (lambda (i)
(set! RECURSION-DEPTH i)
@ -292,7 +292,7 @@
(go depth)
(use-up-time go))])
'(when (pair? (car result))
(fprintf (current-error-port) "we ~a~n"
(fprintf (current-error-port) "we ~a\n"
(if (= (caar result) LOSER-GOODNESS)
"lose"
"win")))

View File

@ -318,7 +318,7 @@
(loop (- i 1))]))
(set! biggest-so-far (max biggest-so-far (calc-score answer)))
(set! tests (+ tests 1))
(printf "tests: ~a sofar: ~a largest connected region: ~a score ~a~n"
(printf "tests: ~a sofar: ~a largest connected region: ~a score ~a\n"
tests
biggest-so-far
answer

View File

@ -44,7 +44,7 @@
[(struct:line) make-line]
[(struct:merge) make-tmerge]
[(struct:turtles/offset) make-turtles/offset]
[else (error 'vec->struc "unknown structure: ~s~n" sexp)])
[else (error 'vec->struc "unknown structure: ~s\n" sexp)])
(map vec->struc (vector-ref sexp 1)))]
[else sexp]))

View File

@ -866,7 +866,7 @@
(define/public (print-to-console v)
;; ==drscheme eventspace thread==
;; only when a user thread is suspended
(do-in-user-thread (lambda () (fprintf (current-error-port) " ### DEBUGGER: ~s~n" v))))
(do-in-user-thread (lambda () (fprintf (current-error-port) " ### DEBUGGER: ~s\n" v))))
(define (frame->end-breakpoint-status frame)
(let/ec k
@ -1098,7 +1098,7 @@
(for-each
(lambda (name/value)
(let ([name (format "~a" (syntax-e (first name/value)))]
[value (format " => ~s~n" (second name/value))])
[value (format " => ~s\n" (second name/value))])
(send variables-text insert name)
(send variables-text change-style bold-sd
(- (send variables-text last-position) (string-length name))
@ -1135,7 +1135,7 @@
(unless already-stopped?
(send stack-frames delete 0 (send stack-frames last-position))
(for-each (lambda (trimmed-expr)
(send stack-frames insert (format "~a~n" trimmed-expr)))
(send stack-frames insert (format "~a\n" trimmed-expr)))
trimmed-exprs))
(send stack-frames change-style normal-sd 0 (send stack-frames last-position))
(send stack-frames change-style bold-sd

View File

@ -123,11 +123,11 @@
(define (display-mark mark)
(apply
string-append
(format "source: ~a~n" (mz:syntax-object->datum (mark-source mark)))
(format "label: ~a~n" (mark-label mark))
(format "bindings:~n")
(format "source: ~a\n" (mz:syntax-object->datum (mark-source mark)))
(format "label: ~a\n" (mark-label mark))
(format "bindings:\n")
(map (lambda (binding)
(format " ~a : ~a~n" (syntax-e (mark-binding-binding binding))
(format " ~a : ~a\n" (syntax-e (mark-binding-binding binding))
(mark-binding-value binding)))
(mark-bindings mark))))
@ -152,7 +152,7 @@
(lookup-first-binding (lambda (id2) (mz:module-identifier=? id id2))
mark-list
(lambda ()
(error 'lookup-binding "variable not found in environment: ~a~n" (if (syntax? id)
(error 'lookup-binding "variable not found in environment: ~a\n" (if (syntax? id)
(mz:syntax-object->datum id)
id))))))

View File

@ -213,11 +213,11 @@
(cond
[(or (eof-object? ans) (eq? ans 'x)) (void)]
[(not (number? ans))
(printf "The input must be a number. Given: ~s~n" ans) (repl)]
(printf "The input must be a number. Given: ~s\n" ans) (repl)]
[(number? ans)
(let ([res (f ans)])
(if (number? res)
(printf "~sF corresponds to ~sC~n" ans res)
(printf "~sF corresponds to ~sC\n" ans res)
(error 'convert OUT-ERROR res))
(repl))]
[else (error 'convert "can't happen")])))))
@ -236,10 +236,10 @@
(cond
[(eof-object? in) (void)]
[(number? in) (begin (check-and-print (f in)) (read-until-eof))]
[else (error 'convert "The input must be a number. Given: ~e~n" in)])))
[else (error 'convert "The input must be a number. Given: ~e\n" in)])))
(define (check-and-print out)
(cond
[(number? out) (printf "~s~n" out)]
[(number? out) (printf "~s\n" out)]
[else (error 'convert OUT-ERROR out)])))
read-until-eof))

View File

@ -73,7 +73,7 @@
;; Symbol (union true String) String X -> void
(define (check-list-list pname condition pred given)
(when (string? condition)
(tp-error pname (string-append condition (format "~nin ~e" given)))))
(tp-error pname (string-append condition (format "\nin ~e" given)))))
;; Symbol (_ -> Boolean) String X X *-> X
(define (check-result pname pred? expected given . other-given)

View File

@ -52,7 +52,7 @@
(format "number in 0 ...~s" GUESS) "first" i)
'(if (and (number? i) (integer? i) (exact? i) (<= 0 i (sub1 GUESS)))
...
(printf "control: improper index, expected 0 ... ~s~n" GUESS))
(printf "control: improper index, expected 0 ... ~s\n" GUESS))
(send (list-ref guess-choices (- GUESS i 1)) get-selection))
;; connect : (button% control-event% -> true) -> true
@ -61,7 +61,7 @@
(define (connect/proc call-back)
(check-proc 'connect call-back 2 '1st "2 arguments")
(if check-button
(printf "connect: called a second time~n")
(printf "connect: called a second time\n")
(begin
(set! check-button
(make-object button% "Check" guess-panel call-back '(border)))

View File

@ -44,7 +44,7 @@
(define (connect/proc call-back)
(check-proc 'connect call-back 2 '1st "2 arguments")
(if button
(printf "connect: called a second time~n")
(printf "connect: called a second time\n")
(begin
(set! button (make-object button% "LookUp" panel call-back '(border)))
(send query-tf focus)

View File

@ -18,5 +18,5 @@
'sorry_all_wrong]))
(define (go/proc s)
(printf "Have fun playing, ~a~n" s)
(printf "Have fun playing, ~a\n" s)
(master compare)))

View File

@ -480,7 +480,7 @@
(loop (add1 port-no) (add1 attempts))]
[else
(error 'get-next-port
"Couldn't find an available port between ~a and ~a~n"
"Couldn't find an available port between ~a and ~a\n"
starting-at (+ starting-at max-attempts))]))))
;; the current-server is a (make-parameter (or/c #f a-server))

View File

@ -22,7 +22,7 @@
(define OUT "convert-out.dat")
(define (create-convert-in)
(printf "212 32~n-40~n"))
(printf "212 32\n-40\n"))
(define (check-convert-out)
(and (= (read) 100)

View File

@ -14,7 +14,7 @@
(define call-back
(lambda (x)
(begin
(draw-message msg (format "~s ~s~n" (choice-index chc) (text-contents txt)))
(draw-message msg (format "~s ~s\n" (choice-index chc) (text-contents txt)))
(draw-message msg "Bye World"))))
(define (destroy x) (hide-window x))

View File

@ -8,7 +8,7 @@
[(_ form ...)
(syntax
(with-handlers ([exn? (lambda (e)
(printf "~a~n" (exn-message e))
(printf "~a\n" (exn-message e))
#t)])
form ...
#f))])))

View File

@ -84,7 +84,7 @@ Reads HTML from a port, producing an @xexpr compatible with the
[(struct h:html-element (attributes))
'()]))
(printf "~s~n" (extract-pcdata an-html)))
(printf "~s\n" (extract-pcdata an-html)))
(require 'html-example)
]

View File

@ -30,7 +30,7 @@
;; Symbol (union true String) String X -> void
(define (check-list-list pname condition pred given)
(when (string? condition)
(error pname (string-append condition (format "~nin ~e" given)))))
(error pname (string-append condition (format "\nin ~e" given)))))
;; Symbol (_ -> Boolean) String X -> X
(define (check-result pname pred? expected given)

View File

@ -249,9 +249,9 @@
(lambda (stx #:allow-nonstx? [allow-nonstx? #f] #:default [default #f])
(let ([replacement (hash-ref table stx #f)])
(if replacement
(begin #;(printf " replacing ~s with ~s~n" stx replacement)
(begin #;(printf " replacing ~s with ~s\n" stx replacement)
replacement)
(begin #;(printf " not replacing ~s~n" stx)
(begin #;(printf " not replacing ~s\n" stx)
default)))))
(define (make-renames-table from0 to0)

View File

@ -36,10 +36,10 @@
[old-parts (stx->list old-expr)])
;; FIXME
(unless (= (length new-parts) (length old-parts))
(printf "** syntax/restamp~n~s~n" (quote-syntax #,stx))
(printf "pattern : ~s~n" (syntax->datum #'(pa (... ...))))
(printf "old parts: ~s~n" (map syntax->datum old-parts))
(printf "new parts: ~s~n" (map syntax->datum new-parts)))
(printf "** syntax/restamp\n~s\n" (quote-syntax #,stx))
(printf "pattern : ~s\n" (syntax->datum #'(pa (... ...))))
(printf "old parts: ~s\n" (map syntax->datum old-parts))
(printf "new parts: ~s\n" (map syntax->datum new-parts)))
(d->so
old-expr
(map (lambda (new old) (syntax/restamp pa new old))
@ -49,10 +49,10 @@
;; FIXME
#'(begin
(unless (and (stx-pair? new-expr) (stx-pair? old-expr))
(printf "** syntax/restamp~n~s~n" (quote-syntax #,stx))
(printf "pattern : ~s~n" (syntax->datum (quote-syntax (pa . pb))))
(printf "old parts: ~s~n" old-expr)
(printf "new parts: ~s~n" new-expr))
(printf "** syntax/restamp\n~s\n" (quote-syntax #,stx))
(printf "pattern : ~s\n" (syntax->datum (quote-syntax (pa . pb))))
(printf "old parts: ~s\n" old-expr)
(printf "new parts: ~s\n" new-expr))
(let ([na (stx-car new-expr)]
[nb (stx-cdr new-expr)]
[oa (stx-car old-expr)]

View File

@ -18,7 +18,7 @@
(define val (cdr sig+val))
(define t (tokenize sig val pos))
(send browser add-text
(format "Signal: ~s: ~s~n"
(format "Signal: ~s: ~s\n"
pos
(token-name (position-token-token t))))
(when val

View File

@ -50,7 +50,7 @@
[val (cdr sig+val)]
[t (tokenize sig val pos)])
(when (trace-verbose?)
(printf "~s: ~s~n" pos
(printf "~s: ~s\n" pos
(token-name (position-token-token t))))
(set! pos (add1 pos))
t))))

View File

@ -255,19 +255,19 @@
;; display-kv : any any -> void
(define/private (display-kv key value)
(display (format "~a~n" key) key-sd)
(display (format "~s~n~n" value) #f))
(display (format "~a\n" key) key-sd)
(display (format "~s\n\n" value) #f))
;; display-subkv : any any -> void
(define/public (display-subkv k v)
(display (format "~a: " k) sub-key-sd)
(display (format "~a~n" v) #f))
(display (format "~a\n" v) #f))
(define/public (display-subkv/value k v)
(display-subkv k v)
#;
(begin
(display (format "~a:~n" k) sub-key-sd)
(display (format "~a:\n" k) sub-key-sd)
(let* ([value-text (new text:standard-style-list% (auto-wrap #t))]
[value-snip (new editor-snip% (editor value-text))]
[value-port (make-text-port value-text)])

View File

@ -17,7 +17,7 @@
(export make:collection^)
(define (make-collection collection-name collection-files argv)
(printf "building collection ~a: ~a~n" collection-name collection-files)
(printf "building collection ~a: ~a\n" collection-name collection-files)
(let* ([zo-compiler #f]
[src-dir (current-directory)]
[sses (sort collection-files

View File

@ -91,7 +91,7 @@
variant-dir)]
[dest-file.so (build-path dest-dir (append-extension-suffix base-file))])
(make-directory* dest-dir)
(printf " Copying ~a~n to ~a~n" file.so dest-file.so)
(printf " Copying ~a\n to ~a\n" file.so dest-file.so)
(when (file-exists? dest-file.so)
(delete-file dest-file.so))
(copy-file file.so dest-file.so))

View File

@ -18,7 +18,7 @@
(case mode
[(no-cache) (error 'cache/file "No cache available: ~a" pth)]
[(cache always)
#;(printf "cache/file: running ~S for ~a~n" thnk pth)
#;(printf "cache/file: running ~S for ~a\n" thnk pth)
(recompute!)]))])
(read-cache pth))]))

View File

@ -17,9 +17,9 @@
(define (make-archive rev)
(define archive-path (revision-archive rev))
(if (file-exists? archive-path)
(printf "r~a is already archived~n" rev)
(printf "r~a is already archived\n" rev)
(local [(define tmp-path (make-temporary-file))]
(printf "Archiving r~a~n" rev)
(printf "Archiving r~a\n" rev)
(create-archive tmp-path (revision-dir rev))
(rename-file-or-directory tmp-path archive-path)
(archive-directory (revision-log-dir rev))

View File

@ -115,7 +115,7 @@
(thread
(lambda ()
(subprocess-wait the-process)
(printf "Killing parent because wrapper is dead...~n")
(printf "Killing parent because wrapper is dead...\n")
(kill-thread parent))))]
; Run without stdin

View File

@ -6,17 +6,17 @@
(define replay-event
(match-lambda
[(struct stdout (bs))
(fprintf (current-output-port) "~a~n" bs)]
(fprintf (current-output-port) "~a\n" bs)]
[(struct stderr (bs))
(fprintf (current-error-port) "~a~n" bs)]))
(fprintf (current-error-port) "~a\n" bs)]))
(define (replay-status s)
(for-each replay-event (status-output-log s))
#;(when (timeout? s)
(fprintf (current-error-port) "[replay-log] TIMEOUT!~n"))
(fprintf (current-error-port) "[replay-log] TIMEOUT!\n"))
#;(when (exit? s)
(fprintf (current-error-port) "[replay-log] Exit code: ~a~n" (exit-code s)))
#;(printf "[replay-log] Took ~a~n"
(fprintf (current-error-port) "[replay-log] Exit code: ~a\n" (exit-code s)))
#;(printf "[replay-log] Took ~a\n"
(format-duration-ms (status-duration s)))
(replay-exit-code s))

View File

@ -113,7 +113,7 @@
empty]
[(read-commit in-p)
=> (lambda (c)
(printf "~S~n" c)
(printf "~S\n" c)
(list* c (read-commits in-p)))]
[else
empty]))

View File

@ -1,6 +1,6 @@
#lang scheme
(printf "Setting the default browser to something safe...~n")
(printf "Setting the default browser to something safe...\n")
; XXX maybe have it call /quit
(put-preferences

View File

@ -6,6 +6,6 @@
(fprintf (if (even? i)
(current-error-port)
(current-output-port))
"~a~n"
"~a\n"
i))

View File

@ -20,7 +20,7 @@
(define log
(read-cache* (build-path (revision-log-dir rev) filename)))
(when log
(printf "~S~n"
(printf "~S\n"
(list rev
(status-duration log)
(filter-map
@ -39,7 +39,7 @@
(define data-file (path-timing-log filename))
(with-handlers ([exn:fail? void])
(make-parent-directory data-file))
(printf "Making log for ~a~n" filename)
(printf "Making log for ~a\n" filename)
(if revision
(with-output-to-file

View File

@ -12,7 +12,7 @@
current-ps-cmap-file-paths)
(define (report-exn exn)
(log-error (format "PostScript/AFM error: ~a~n"
(log-error (format "PostScript/AFM error: ~a\n"
(if (exn? exn)
(exn-message exn)
exn))))
@ -508,7 +508,7 @@
(when special-font
(let ([name (afm-expand-name special-font-name)])
(hash-set! used-fonts name #t)
(fprintf out "currentfont~n/~a findfont~n~a scalefont setfont~n"
(fprintf out "currentfont\n/~a findfont\n~a scalefont setfont\n"
name
size)))
(if (font-is-cid? (or special-font font))
@ -545,7 +545,7 @@
(fprintf out "(~a) show\n" bytes)))))))
(when special-font
;; Uses result of currentfont above:
(fprintf out "setfont~n"))))])
(fprintf out "setfont\n"))))])
(fprintf out "0 -~a rmoveto\n" (/ (* size (- (font-height font) (font-descent font))) 1000.0))
(let loop ([l l][simples null][special-font-name #f][special-font #f])
(cond
@ -617,11 +617,11 @@
this-font)
(begin
;; Not simple... use glyphshow
(fprintf out "gsave~n/~a findfont~n~a scalefont setfont~n"
(fprintf out "gsave\n/~a findfont\n~a scalefont setfont\n"
(afm-expand-name this-font-name)
size)
(fprintf out "/~a glyphshow\n" (achar-enc achar))
(fprintf out "grestore~n")
(fprintf out "grestore\n")
(loop (cdr l) null #f #f))))))
(lambda ()
;; No mapping for the character anywhere.

View File

@ -30,7 +30,7 @@
(let loop ()
(let ([l (read-line p)])
(unless (eof-object? l)
(fprintf orig-err "~a~n" l)
(fprintf orig-err "~a\n" l)
(loop)))))
(lambda () (close-input-port p))))))])
(echo in)

View File

@ -22,13 +22,13 @@
(when f (f i))))]
[on-select
(lambda (i)
(printf "Selected: ~a~n"
(printf "Selected: ~a\n"
(if i
(send (send i get-editor) get-flattened-text)
i)))]
[on-double-select
(lambda (s)
(printf "Double-click: ~a~n"
(printf "Double-click: ~a\n"
(send (send s get-editor) get-flattened-text)))])
(sequence (apply super-init args)))
p))

View File

@ -157,7 +157,7 @@ neck and it is the most readable solution.
($ dim x width stretchable-width?)
($ dim y height stretchable-height?))
others ...)
(printf "(make-rect (make-dim ~s ~s ~s) (make-dim ~s ~s ~s))~n"
(printf "(make-rect (make-dim ~s ~s ~s) (make-dim ~s ~s ~s))\n"
x width stretchable-width?
y height stretchable-height?)
(rect-print others)]))

View File

@ -26,12 +26,12 @@
(send snip get-margin l t r b)
(printf "get-margin: ~sX~s ~sX~s\n" (unbox l) (unbox r) (unbox t) (unbox b)))
(printf "get-max-height: ~s~n" (send snip get-max-height))
(printf "get-max-width: ~s~n" (send snip get-max-width))
(printf "get-min-height: ~s~n" (send snip get-min-height))
(printf "get-min-width: ~s~n" (send snip get-min-width))
;(printf "snip-width: ~s~n" (send pasteboard snip-width snip))
;(printf "snip-height: ~s~n" (send pasteboard snip-height snip))
(printf "get-max-height: ~s\n" (send snip get-max-height))
(printf "get-max-width: ~s\n" (send snip get-max-width))
(printf "get-min-height: ~s\n" (send snip get-min-height))
(printf "get-min-width: ~s\n" (send snip get-min-width))
;(printf "snip-width: ~s\n" (send pasteboard snip-width snip))
;(printf "snip-height: ~s\n" (send pasteboard snip-height snip))
))
;;debug-pasteboard: -> (void)

View File

@ -8,7 +8,7 @@
"../aligned-pasteboard.ss"
"../aligned-editor-container.ss")
;; (printf "running tests for pasteboard-lib.ss~n")
;; (printf "running tests for pasteboard-lib.ss\n")
;;pasteboard-root: ((is-a?/c aligned-pasteboard<%>) -> (is-a?/c aligned-pasteboard<%>))
;;gets the top most aligned pasteboard in the tree of pasteboards and containers
@ -203,5 +203,5 @@
(send frame show false)
)
(printf "tests done~n")
(printf "tests done\n")
|#

View File

@ -8,7 +8,7 @@
"../aligned-editor-container.ss"
"test-macro.ss")
;;(printf "running tests for snip-lib.ss~n")
;;(printf "running tests for snip-lib.ss\n")
;;snip-width: ((is-a?/c aligned-pasteboard<%>) (is-a?/c snip%) . -> . number?)
;;the width of a snip in the given pasteboard
@ -205,4 +205,4 @@
(send frame show false)
)
;;(printf "tests done~n")
;;(printf "tests done\n")

View File

@ -21,7 +21,7 @@
; ;
; ;;;
(printf "running test1.ss~n")
(printf "running test1.ss\n")
(define frame
(instantiate frame% ()
@ -228,4 +228,4 @@
)
(send frame show false)
(printf "done~n")
(printf "done\n")

View File

@ -22,7 +22,7 @@
; ;;;
;
(printf "running test2.ss~n")
(printf "running test2.ss\n")
(define frame
(instantiate frame% ()
@ -186,4 +186,4 @@
)
(send frame show false)
(printf "done~n")
(printf "done\n")

View File

@ -46,7 +46,7 @@
[(left top) 0]
[(right bottom) (- total-size item-size)]
[else (error 'place-children
"alignment spec is unknown ~a~n" spec)])))])
"alignment spec is unknown ~a\n" spec)])))])
(map (lambda (l)
(let*-values ([(min-width min-height v-stretch? h-stretch?)
(apply values l)]

View File

@ -149,7 +149,7 @@
(let ([count 0])
(lambda (ev)
(when (send ev mousemove?)
(printf "mousemove #~a, but who's counting?~n" count)
(printf "mousemove #~a, but who's counting?\n" count)
(set! count (add1 count))))))
(define (today-handler ev)
@ -198,7 +198,7 @@
(send ctrldoc find-element "CAPTION" "Caption")
(lambda (ev)
(when (send ev keypress?)
(printf "ooh that tickles~n"))))
(printf "ooh that tickles\n"))))
(for-each
(lambda (sym-handler)

View File

@ -2450,7 +2450,7 @@
(with-handlers
([void
(lambda (e)
(printf "~a~n" (exn-message e))
(printf "~a\n" (exn-message e))
(loop))])
(mxprims:get-event browser))]
[event (make-object mx-event% prim-event)]

View File

@ -289,7 +289,7 @@
(if (<= input test)
'input-smaller
'test-smaller)))]))])
; (printf "~a ~a ~a~n" compare secs (date->string date))
; (printf "~a ~a ~a\n" compare secs (date->string date))
(cond
[(eq? compare 'equal) secs]
[(or (= secs below-secs) (= secs above-secs))

View File

@ -8,7 +8,7 @@
(let* defs
(let ((real-ans code))
(unless (equal? real-ans right-ans)
(printf "Test failed: ~e gave ~e. Expected ~e~n"
(printf "Test failed: ~e gave ~e. Expected ~e\n"
'code real-ans 'right-ans))) ...))))
(define-syntax test-block

View File

@ -17,8 +17,8 @@
[print-error
(lambda (e)
(if (exn? e)
(fprintf (current-error-port) "~a~n" (exn-message e))
(fprintf (current-error-port) "Exception in init file: ~e~n" e)))]
(fprintf (current-error-port) "~a\n" (exn-message e))
(fprintf (current-error-port) "Exception in init file: ~e\n" e)))]
[beginize (lambda (l)
(string-append
"(begin "

View File

@ -115,7 +115,7 @@
;; coroutine : ((bool ->) -> X) -> X-coroutine-object
(define (coroutine f)
;;(printf "2. new coroutine~n")
;;(printf "2. new coroutine\n")
(let* ([can-stop-lock (make-semaphore 1)]
[done-ch (make-channel)]
[ex-ch (make-channel)]
@ -123,7 +123,7 @@
[stop-enabled? #t]
[enable-stop
(lambda (enable?)
;;(printf "3. enabling ~a~n" enable?)
;;(printf "3. enabling ~a\n" enable?)
(cond
[(and enable? (not stop-enabled?))
(semaphore-post can-stop-lock)
@ -131,11 +131,11 @@
[(and (not enable?) stop-enabled?)
(semaphore-wait can-stop-lock)
(set! stop-enabled? #f)])
;;(printf "3. finished enabling~n")
;;(printf "3. finished enabling\n")
)]
[tid (thread (lambda ()
(semaphore-wait proceed-sema)
;;(printf "3. creating coroutine thread~n")
;;(printf "3. creating coroutine thread\n")
(with-handlers ([(lambda (exn) #t)
(lambda (exn)
(enable-stop #t)
@ -152,7 +152,7 @@
(if (coroutine-object-worker w)
(let ([can-stop-lock (coroutine-object-can-stop-lock w)]
[worker (coroutine-object-worker w)])
#;(printf "2. starting coroutine~n")
#;(printf "2. starting coroutine\n")
(thread-resume worker)
(dynamic-wind
void
@ -162,20 +162,20 @@
timeout
(alarm-evt (+ timeout (current-inexact-milliseconds))))
(lambda (x)
#;(printf "2. alarm-evt~n")
#;(printf "2. alarm-evt\n")
(semaphore-wait can-stop-lock)
(thread-suspend worker)
(semaphore-post can-stop-lock)
#f))
(wrap-evt (coroutine-object-done-ch w)
(lambda (res)
#;(printf "2. coroutine-done-evt~n")
#;(printf "2. coroutine-done-evt\n")
(set-coroutine-object-result! w res)
(coroutine-kill w)
#t))
(wrap-evt (coroutine-object-ex-ch w)
(lambda (exn)
#;(printf "2. ex-evt~n")
#;(printf "2. ex-evt\n")
(coroutine-kill w)
(raise exn))))))
;; In case we escape through a break:

View File

@ -8,7 +8,7 @@
(lambda (load)
(lambda (filename expected-module)
(fprintf ep
"~aloading ~a at ~a~n"
"~aloading ~a at ~a\n"
tab filename (current-process-milliseconds))
(begin0
(let ([s tab])
@ -18,7 +18,7 @@
(load filename expected-module))
(lambda () (set! tab s))))
(fprintf ep
"~adone ~a at ~a~n"
"~adone ~a at ~a\n"
tab filename (current-process-milliseconds)))))])
(current-load (mk-chain load))
(current-load-extension (mk-chain load-extension))))

View File

@ -82,7 +82,7 @@
(lambda ()
(let ((result (calcp (lambda () (calcl ip)))))
(when result
(printf "~a~n" result)
(printf "~a\n" result)
(one-line))))))
(one-line)))

View File

@ -113,7 +113,7 @@
(let ((next-check (vector-ref next 1)))
(or (>= next-check max-char-num)
(loop (add1 next-check) (cdr nexts))))))))))
(printf "Warning: lexer at ~a can accept the empty string.~n" stx)))
(printf "Warning: lexer at ~a can accept the empty string.\n" stx)))
(with-syntax ((start-state-stx start)
(trans-table-stx trans)
(no-lookahead-stx no-look)
@ -230,7 +230,7 @@
(lambda (ip)
(let ((first-pos (get-position ip))
(first-char (peek-char-or-special ip 0)))
;(printf "(peek-char-or-special port 0) = ~e~n" first-char)
;(printf "(peek-char-or-special port 0) = ~e\n" first-char)
(cond
((eof-object? first-char)
(do-match ip first-pos eof-action (read-char-or-special ip)))
@ -279,7 +279,7 @@
(let* ((act (vector-ref actions next-state))
(next-length-bytes (+ (char-utf-8-length char) length-bytes))
(next-char (peek-char-or-special ip next-length-bytes)))
#;(printf "(peek-char-or-special port ~e) = ~e~n"
#;(printf "(peek-char-or-special port ~e) = ~e\n"
next-length-bytes next-char)
(lexer-loop next-state
next-char
@ -312,13 +312,13 @@
(position-offset first-pos)
(- (position-offset end-pos) (position-offset first-pos)))))
(let ((match (read-string longest-match-length lb)))
;(printf "(read-string ~e port) = ~e~n" longest-match-length match)
;(printf "(read-string ~e port) = ~e\n" longest-match-length match)
(do-match lb first-pos longest-match-action match)))
(define file-path (make-parameter #f))
(define (do-match ip first-pos action value)
#;(printf "(action ~a ~a ~a ~a)~n"
#;(printf "(action ~a ~a ~a ~a)\n"
(position-offset first-pos) (position-offset (get-position ip)) value ip)
(action first-pos (get-position ip) value ip))

View File

@ -281,13 +281,13 @@
(else (loop old-states new-states all-states (cdr cs))))))))))
(define (print-dfa x)
(printf "number of states: ~a~n" (dfa-num-states x))
(printf "start state: ~a~n" (dfa-start-state x))
(printf "final states: ~a~n" (map car (dfa-final-states/actions x)))
(printf "number of states: ~a\n" (dfa-num-states x))
(printf "start state: ~a\n" (dfa-start-state x))
(printf "final states: ~a\n" (map car (dfa-final-states/actions x)))
(for-each (lambda (trans)
(printf "state: ~a~n" (car trans))
(printf "state: ~a\n" (car trans))
(for-each (lambda (rule)
(printf " -~a-> ~a~n"
(printf " -~a-> ~a\n"
(is:integer-set-contents (car rule))
(cdr rule)))
(cdr trans)))

View File

@ -170,7 +170,7 @@
(vector->list x))))
(vector->list table))
(length (hash-table-map ht cons)))))
(printf "~a states, ~aKB~n"
(printf "~a states, ~aKB\n"
num-states
(/ (* 4.0 (+ 2 num-states (* 2 num-vectors) num-entries
(* 5 num-different-entries))) 1024)))

View File

@ -14,7 +14,7 @@
(let* defs
(let ((real-ans code))
(unless (equal? real-ans right-ans)
(printf "Test failed: ~e gave ~e. Expected ~e~n"
(printf "Test failed: ~e gave ~e. Expected ~e\n"
'code real-ans 'right-ans))) ...))))
(define-syntax test-block

View File

@ -149,14 +149,14 @@
(print-input-st-prod l "LA" a g print-output-terms))
(define (print-input-st-sym f name a g print-output)
(printf "~a:~n" name)
(printf "~a:\n" name)
(send a for-each-state
(lambda (state)
(for-each
(lambda (non-term)
(let ((res (f (make-trans-key state non-term))))
(if (not (null? res))
(printf "~a(~a, ~a) = ~a~n"
(printf "~a(~a, ~a) = ~a\n"
name
state
(gram-sym-symbol non-term)
@ -165,7 +165,7 @@
(newline))
(define (print-input-st-prod f name a g print-output)
(printf "~a:~n" name)
(printf "~a:\n" name)
(send a for-each-state
(lambda (state)
(for-each
@ -174,7 +174,7 @@
(lambda (prod)
(let ((res (f state prod)))
(if (not (null? res))
(printf "~a(~a, ~a) = ~a~n"
(printf "~a(~a, ~a) = ~a\n"
name
(kernel-index state)
(prod-index prod)

View File

@ -167,7 +167,7 @@
;; build-LR0-automaton: grammar -> LR0-automaton
;; Constructs the kernels of the sets of LR(0) items of g
(define (build-lr0-automaton grammar)
; (printf "LR(0) automaton:~n")
; (printf "LR(0) automaton:\n")
(letrec (
(epsilons (make-hash-table 'equal))
(grammar-symbols (append (send grammar get-non-terms)
@ -304,7 +304,7 @@
(set! automaton-non-term (cons (cons (make-trans-key kernel gs)
unique-kernel)
automaton-non-term))))
#;(printf "~a -> ~a on ~a~n"
#;(printf "~a -> ~a on ~a\n"
(kernel->string kernel)
(kernel->string unique-kernel)
(gram-sym-symbol gs))

View File

@ -91,9 +91,9 @@
(hash-table-put! ht x #t)))
(map cdr (apply append (vector->list table))))
(length (hash-table-map ht void)))))
(printf "~a states, ~a grammar symbols, ~a hash-table entries, ~a reduces~n"
(printf "~a states, ~a grammar symbols, ~a hash-table entries, ~a reduces\n"
num-states num-gram-syms num-ht-entries num-reduces)
(printf "~a -- ~aKB, previously ~aKB~n"
(printf "~a -- ~aKB, previously ~aKB\n"
(/ (+ 2 num-states
(* 4 num-states) (* 2 1.5 num-ht-entries)
(* 5 num-reduces)) 256.0)

View File

@ -97,16 +97,16 @@
(for-each
(lambda (prod)
(fprintf port
"~a\t~a\t=\t~a~n"
"~a\t~a\t=\t~a\n"
(prod-index prod)
(gram-sym-symbol (prod-lhs prod))
(map gram-sym-symbol (vector->list (prod-rhs prod)))))
prods)
(send a for-each-state
(lambda (state)
(fprintf port "State ~a~n" (kernel-index state))
(fprintf port "State ~a\n" (kernel-index state))
(for-each (lambda (item)
(fprintf port "\t~a~n" (item->string item)))
(fprintf port "\t~a\n" (item->string item)))
(kernel-items state))
(newline port)
(for-each
@ -118,22 +118,22 @@
((null? (cdr act))
(print-entry sym (car act) port))
(else
(fprintf port "begin conflict:~n")
(fprintf port "begin conflict:\n")
(when (> (count reduce? act) 1)
(set! RR-conflicts (add1 RR-conflicts)))
(when (> (count shift? act) 0)
(set! SR-conflicts (add1 SR-conflicts)))
(map (lambda (x) (print-entry sym x port)) act)
(fprintf port "end conflict~n")))))
(fprintf port "end conflict\n")))))
(vector-ref grouped-table (kernel-index state)))
(newline port)))
(when (> SR-conflicts 0)
(fprintf port "~a shift/reduce conflict~a~n"
(fprintf port "~a shift/reduce conflict~a\n"
SR-conflicts
(if (= SR-conflicts 1) "" "s")))
(when (> RR-conflicts 0)
(fprintf port "~a reduce/reduce conflict~a~n"
(fprintf port "~a reduce/reduce conflict~a\n"
RR-conflicts
(if (= RR-conflicts 1) "" "s")))))
@ -159,7 +159,7 @@
(loop (car rest) (cdr rest)))
((accept? (car rest))
(fprintf (current-error-port)
"accept/reduce or accept/shift conflicts. Check the grammar for useless cycles of productions~n")
"accept/reduce or accept/shift conflicts. Check the grammar for useless cycles of productions\n")
(loop current-guess (cdr rest)))
(else (loop current-guess (cdr rest)))))))))
@ -180,12 +180,12 @@
(unless suppress
(when (> SR-conflicts 0)
(fprintf (current-error-port)
"~a shift/reduce conflict~a~n"
"~a shift/reduce conflict~a\n"
SR-conflicts
(if (= SR-conflicts 1) "" "s")))
(when (> RR-conflicts 0)
(fprintf (current-error-port)
"~a reduce/reduce conflict~a~n"
"~a reduce/reduce conflict~a\n"
RR-conflicts
(if (= RR-conflicts 1) "" "s"))))
table))

View File

@ -74,7 +74,7 @@
(car rhs))
(if (= 3 (length rhs))
(p "%prec ~a" (cadadr rhs)))
(p "~n"))))
(p "\n"))))
(for-each
(lambda (t)
(for-each
@ -86,7 +86,7 @@
(lambda (t)
(for-each
(lambda (t)
(p "%token ~a~n" t)
(p "%token ~a\n" t)
(hash-table-put! term-table t (format "~a" t)))
(syntax-object->datum (terminals-def-t t))))
terms)
@ -96,10 +96,10 @@
(for-each (lambda (tok)
(p " ~a" (hash-table-get term-table tok)))
(cdr prec))
(p "~n"))
(p "\n"))
precs))
(p "%start ~a~n" start)
(p "%%~n")
(p "%start ~a\n" start)
(p "%%\n")
(for-each (lambda (prod)
(let ((nt (car prod)))
@ -109,9 +109,9 @@
(p "| ")
(display-rhs rhs))
(cddr prod))
(p ";~n")))
(p ";\n")))
grammar)
(p "%%~n"))))
(p "%%\n"))))
)

View File

@ -174,7 +174,7 @@
(lambda (e)
(fprintf
(current-error-port)
"Cannot write yacc-output to file \"~a\"~n"
"Cannot write yacc-output to file \"~a\"\n"
yacc-output)))]
(call-with-output-file yacc-output
(lambda (port)
@ -271,14 +271,14 @@
(let ((a (find-action stack tok val start-pos end-pos)))
(cond
((runtime-shift? a)
;; (printf "shift:~a~n" (runtime-shift-state a))
;; (printf "shift:~a\n" (runtime-shift-state a))
(cons (make-stack-frame (runtime-shift-state a)
val
start-pos
end-pos)
stack))
(else
;; (printf "discard input:~a~n" tok)
;; (printf "discard input:~a\n" tok)
(let-values (((tok val start-pos end-pos)
(extract (get-token))))
(remove-input tok val start-pos end-pos))))))))
@ -286,7 +286,7 @@
(let ((a (find-action stack 'error #f start-pos end-pos)))
(cond
((runtime-shift? a)
;; (printf "shift:~a~n" (runtime-shift-state a))
;; (printf "shift:~a\n" (runtime-shift-state a))
(set! stack
(cons
(make-stack-frame (runtime-shift-state a)
@ -296,7 +296,7 @@
stack))
(remove-input tok val start-pos end-pos))
(else
;; (printf "discard state:~a~n" (car stack))
;; (printf "discard state:~a\n" (car stack))
(cond
((< (length stack) 2)
(raise-read-error "parser: Cannot continue after error"
@ -330,7 +330,7 @@
(let ((action (find-action stack tok val start-pos end-pos)))
(cond
((runtime-shift? action)
;; (printf "shift:~a~n" (runtime-shift-state action))
;; (printf "shift:~a\n" (runtime-shift-state action))
(parsing-loop (cons (make-stack-frame (runtime-shift-state action)
val
start-pos
@ -338,7 +338,7 @@
stack)
(get-token)))
((runtime-reduce? action)
;; (printf "reduce:~a~n" (runtime-reduce-prod-num action))
;; (printf "reduce:~a\n" (runtime-reduce-prod-num action))
(let-values (((new-stack args)
(reduce-stack stack
(runtime-reduce-rhs-length action)
@ -367,7 +367,7 @@
new-stack)
ip))))
((runtime-accept? action)
;; (printf "accept~n")
;; (printf "accept\n")
(stack-frame-value (car stack)))
(else
(if src-pos

View File

@ -265,10 +265,10 @@
[(result-addr)
(cond
[(procedure? result-addr)
(printf "Imported procedure~n")
(printf "Imported procedure\n")
result-addr]
[(location? result-addr)
(printf "Value at location ~a:~n" result-addr)
(printf "Value at location ~a:\n" result-addr)
(gc->scheme result-addr)])])))]))
; Module Begin
@ -304,7 +304,7 @@
(when (gui-available?)
(if (<= (#%datum . heap-size) 500)
(set-ui! (dynamic-require `plai/private/gc-gui 'heap-viz%))
(printf "Large heap; the heap visualizer will not be displayed.~n")))
(printf "Large heap; the heap visualizer will not be displayed.\n")))
(init-allocator))))]
[_ (raise-syntax-error 'mutator
"Mutator must start with an 'allocator-setup' expression, such as: (allocator-setup <module-path> <literal-number>)"

View File

@ -56,4 +56,4 @@
print?))
(when print-name?
(printf "Traces are in ~a~n" traces-file))
(printf "Traces are in ~a\n" traces-file))

View File

@ -44,7 +44,7 @@
(set! failed-tests (+ failed-tests 1))
(unless verbose?
(printf "\ntesting ~s ... " t))
(printf "TEST FAILED!~nexpected:~a\nrewritten-received:~a\nreceived:~a\n\n"
(printf "TEST FAILED!\nexpected:~a\nrewritten-received:~a\nreceived:~a\n\n"
(combine-in-lines expected)
(combine-in-lines rewritten-results)
(combine-in-lines results))))))))

View File

@ -1046,7 +1046,7 @@
(begin
(when #f
(fprintf (current-error-port)
"Undefined link: ~s~n"
"Undefined link: ~s\n"
(tag-key (link-element-tag e) ri)))
`((font ([class "badlink"])
,@(if (empty-content? (element-content e))

View File

@ -143,9 +143,9 @@ Of course, this breaks assignment to the provided variable.
(module b racket
(require a)
(printf "~s~n" amount)
(printf "~s\n" amount)
<font color="red">(do-it)</font>
(printf "~s~n" amount))
(printf "~s\n" amount))
(require b)
</racket>

View File

@ -74,7 +74,7 @@ This code launches two places, echos a message to them and then waits for the pl
(for ([i (in-range 2)]
[p pls])
(place-channel-send p i)
(printf "~a~n" (place-channel-recv p)))
(printf "~a\n" (place-channel-recv p)))
(map place-wait pls))
]

View File

@ -142,7 +142,7 @@ supplied than are used by the format string, the
@examples[
(fprintf (current-output-port)
"~a as a string is ~s.~n"
"~a as a string is ~s.\n"
'(3 4)
"(3 4)")
]}
@ -163,7 +163,7 @@ Formats to a string. The result is the same as
]
@examples[
(format "~a as a string is ~s.~n" '(3 4) "(3 4)")
(format "~a as a string is ~s.\n" '(3 4) "(3 4)")
]}
@defboolparam[print-pair-curly-braces on?]{

View File

@ -30,7 +30,7 @@
(define-foreign-lib lib name type ... -> _void)]
[(_ lib name type ...)
(begin
;; (printf "~a~n" 'name)
;; (printf "~a\n" 'name)
(provide name)
(define name
(get-ffi-obj 'name lib (_fun* type ...) (unavailable 'name))))]))

View File

@ -7,7 +7,7 @@
mrlib/private/aligned-pasteboard/aligned-pasteboard
mrlib/private/aligned-pasteboard/aligned-editor-container)
(printf "running tests for snip-lib.ss~n")
(printf "running tests for snip-lib.ss\n")
;;snip-min-width: ((is-a?/c snip%) . -> . number?)
;;the width of a snip in the given pasteboard

View File

@ -105,7 +105,7 @@
(or (wait-for-drscheme-frame-pred)
(begin
(when print-message?
(printf "Select DrRacket frame~n"))
(printf "Select DrRacket frame\n"))
(poll-until wait-for-drscheme-frame-pred)))))
;; wait-for-new-frame : frame [(listof eventspace) = null] -> frame
@ -529,7 +529,7 @@
[else
(loop (send snip previous)
(cons (format "{unknown snip: ~e}~n" snip)
(cons (format "{unknown snip: ~e}\n" snip)
strings))])]))))))]))
;; run-one/sync : (-> A) -> A

View File

@ -138,7 +138,7 @@ add this test:
(- (send interactions-text last-paragraph) 1)))])
(unless (equal? got-value expected-transcript)
(fprintf (current-error-port)
"FAILED: expected: ~s~n got: ~s~n program: ~s~n input: ~s~n"
"FAILED: expected: ~s\n got: ~s\n program: ~s\n input: ~s\n"
expected-transcript got-value program input)))))
(clear-definitions drs-frame)
@ -159,7 +159,7 @@ add this test:
(do-input-test "(read-line)" "\n" "\n\"\"")
(do-input-test "(read-char)" "\n" "\n#\\newline")
(do-input-test "(list (read) (printf \"1~n\") (read) (printf \"3~n\"))"
(do-input-test "(list (read) (printf \"1\n\") (read) (printf \"3\n\"))"
"0 2\n"
"0 2\n1\n3\n(0 #<void> 2 #<void>)")

View File

@ -48,7 +48,7 @@
(for-each (lambda (f)
(when (file-exists? f)
(printf "trying ~a~n" f)
(printf "trying ~a\n" f)
(let ([str
(call-with-input-file f
(lambda (p)
@ -113,7 +113,7 @@
(for-each
(lambda (f)
(when (file-exists? f)
(printf "trying ~a~n" f)
(printf "trying ~a\n" f)
(let-values ([(zo zi zn ze zf)
(apply values (process* gzip "-c" f))]
[(mi mo) (make-pipe 4096)])

View File

@ -7,7 +7,7 @@
(error 'wait-for-mred-frame
,(format "after ~a seconds, frame labelled ~s didn't appear" timeout name))
(let ([win (get-top-level-focus-window)])
(printf "win: ~a label ~a~n" win (and win (string=? (send win get-label) ,name)))
(printf "win: ~a label ~a\n" win (and win (string=? (send win get-label) ,name)))
(unless (and win (string=? (send win get-label) ,name))
(sleep ,pause-time)
(loop (- n 1)))))))))

View File

@ -35,7 +35,7 @@
((mailbox-receive mb 10 error-timeout (want-thnk 24))) => 24
))
(printf "Channel~n")
(printf "Channel\n")
(test-it! ch:new-mailbox ch:mailbox? ch:mailbox-send! ch:mailbox-receive)
(printf "Semaphore~n")
(printf "Semaphore\n")
(test-it! sema:new-mailbox sema:mailbox? sema:mailbox-send! sema:mailbox-receive)

View File

@ -3,4 +3,4 @@
(==> (filter-e zero? (changes (modulo seconds 10)))
(lambda (v)
(printf "~S~n" (value-now x))))
(printf "~s\n" (value-now x))))

View File

@ -716,7 +716,7 @@
0 0 w h
mode color)
(set! x (+ x w 10))))
(printf "bad bitmap~n")))])
(printf "bad bitmap\n")))])
;; BB icon
(do-one bb 'solid black)
(let ([start x])

View File

@ -8,7 +8,7 @@
f
(begin
(unless printout?
(printf "please select the console~n"))
(printf "please select the console\n"))
(sleep 1/2)
(loop #t)))))]
[wait
@ -67,9 +67,9 @@
[frame (mred:test:get-active-frame)]
[_ (mred:test:keystroke #\3)]
[autosave-time (+ 10 (mred:get-preference 'mred:autosave-delay))]
[_ (printf "waiting for autosave timeout (~a secs)~n" autosave-time)]
[_ (printf "waiting for autosave timeout (~a secs)\n" autosave-time)]
[_ (sleep autosave-time)]
[_ (printf "finished waiting for autosave timeout~n")]
[_ (printf "finished waiting for autosave timeout\n")]
[_ (unless (file-exists? backup-file)
(error 'autosave "autosave file (~a) not created" backup-file))]
[_ (mred:test:menu-select "File" save-name)]
@ -80,7 +80,7 @@
[_ (wait-pending)]
[_ (wait (lambda () (eq? (mred:test:get-active-frame) console))
"focus didn't return to the console after closing autosave test frame")])
(printf "test finished~n")))
(printf "test finished\n")))
;
; when rewriting, apply this function to:

View File

@ -68,7 +68,7 @@
(sleep)
(collect-garbage)
(collect-garbage)
(printf "Thread: ~s Cycle: ~s~n" id n)
(printf "Thread: ~s Cycle: ~s\n" id n)
; (dump-object-stats)
; (if (and dump-stats? (= id 1))
; (dump-memory-stats))
@ -229,7 +229,7 @@
(map (lambda (x)
(let ([v (weak-box-value (cdr x))])
(when v
(printf "~s ~s~n" (car x) v))))
(printf "~s ~s\n" (car x) v))))
allocated)
(void))
@ -243,10 +243,10 @@
(if #f
(thread (lambda ()
(read)
(printf "breaking~n")
(printf "breaking\n")
(break-thread t)
(thread-wait t)
(printf "done~n")))
(printf "done\n")))
(void)))
(define (do-test)

View File

@ -93,7 +93,7 @@
(and (exn:fail? x)
(regexp-match "shutdown" (exn-message x))))
(lambda (x)
(printf "got expected error: ~a~n" (exn-message x))
(printf "got expected error: ~a\n" (exn-message x))
'error)])
(parameterize ([current-eventspace e])
(t)))))

View File

@ -9,7 +9,7 @@
(override
[on-event
(lambda (ev)
(printf "~a~a MOUSE ~a (~a,~a)\n mods:~a~a~a~a~a\n buttons:~a~a~a~a~a~a~a~n"
(printf "~a~a MOUSE ~a (~a,~a)\n mods:~a~a~a~a~a\n buttons:~a~a~a~a~a~a~a\n"
(es-check)
iter
(send ev get-event-type)
@ -38,7 +38,7 @@
[on-char
(lambda (ev)
(set! iter (add1 iter))
(printf "~a~a KEY: ~a\n rel-code: ~a\n other-codes: ~a\n mods:~a~a~a~a~a~n"
(printf "~a~a KEY: ~a\n rel-code: ~a\n other-codes: ~a\n mods:~a~a~a~a~a\n"
(es-check)
iter
(let ([v (send ev get-key-code)])
@ -68,7 +68,7 @@
(inherit accept-drop-files)
(override
[on-drop-file (lambda (file)
(printf "Dropped: ~a~n" file))])
(printf "Dropped: ~a\n" file))])
(sequence
(super-init "tests" #f 100 100)
(accept-drop-files #t)))))

Some files were not shown because too many files have changed in this diff Show More