~ chicken-core (chicken-5) c6791b7b6c2e4cccc6c15ab646b304eff2209a22
commit c6791b7b6c2e4cccc6c15ab646b304eff2209a22 Author: Peter Bex <peter@more-magic.net> AuthorDate: Thu Nov 19 16:51:25 2015 +0100 Commit: Evan Hanson <evhan@foldling.org> CommitDate: Fri Jan 1 22:20:48 2016 +1300 Make ##sys#with-print-limit a bit more consistent This fixes #951, for the most part. Signed-off-by: Evan Hanson <evhan@foldling.org> diff --git a/library.scm b/library.scm index 9be436a4..a6a27f84 100644 --- a/library.scm +++ b/library.scm @@ -3896,8 +3896,7 @@ EOF (define ##sys#print-exit (make-parameter #f)) (define ##sys#print - (let ((string-append string-append) - (case-sensitive case-sensitive) + (let ((case-sensitive case-sensitive) (keyword-style keyword-style)) (lambda (x readable port) (##sys#check-output-port port #t #f) @@ -3911,12 +3910,11 @@ EOF (let* ((len (##sys#size str)) (cpp0 (current-print-length)) (cpl (fx+ cpp0 len)) ) - (if (fx>= cpl length-limit) - (cond ((fx> len 3) - (let ((n (fx- length-limit cpp0))) - (when (fx> n 0) (outstr0 port (##sys#substring str 0 n))) - (outstr0 port "...") ) ) - (else (outstr0 port str)) ) + (if (fx> cpl length-limit) + (let ((n (fx- length-limit cpp0))) + (when (fx> n 0) (outstr0 port (##sys#substring str 0 n))) + (outstr0 port "...") + ((##sys#print-exit) (##sys#void))) (outstr0 port str) ) (current-print-length cpl) ) (outstr0 port str) ) ) @@ -3930,7 +3928,7 @@ EOF (current-print-length (fx+ cpp0 1)) (when (fx>= cpp0 length-limit) (outstr0 port "...") - ((##sys#print-exit) #t) ))) + ((##sys#print-exit) (##sys#void))))) ((##sys#slot (##sys#slot port 2) 2) port chr)) (define (specialchar? chr)Trap