diff --git a/dist/std.min.scm b/dist/std.min.scm index f397fef8b..834f02b0a 100644 --- a/dist/std.min.scm +++ b/dist/std.min.scm @@ -232,7 +232,7 @@ (define (char-upper-case? char) "(char-upper-case? char)\u000A\u000AChecks if character is upper case." (typecheck "char-upper-case?" char "character") (and (char-alphabetic? char) (char=? (char-upcase char) char))) (define (char-lower-case? char) "(char-upper-case? char)\u000A\u000AChecks if character is lower case." (typecheck "char-lower-case?" char "character") (and (char-alphabetic? char) (char=? (char-downcase char) char))) (define (newline . rest) "(newline [port])\u000A\u000AWrite newline character to standard output or given port" (let ((port (if (null? rest) (current-output-port) (car rest)))) (display "\u000A" port))) -(define (write obj . rest) "(write obj [port])\u000A\u000AWrite object to standard output or give port. For strings it will include\u000Awrap in quotes." (let ((port (if (null? rest) (current-output-port) (car rest)))) (display (repr obj #t) port))) +(define (write obj . rest) "(write obj [port])\u000A\u000AWrite object to standard output or give port. For strings it will include\u000Awrap in quotes." (let ((port (if (null? rest) (current-output-port) (car rest)))) (if (binary-port? port) (display obj port) (display (repr obj #t) port)))) (define (write-char char . rest) "(write-char char [port])\u000A\u000AWrite single character to given port using write function." (typecheck "write-char" char "character") (if (not (null? rest)) (typecheck "write-char" (car rest) "output-port")) (apply display (cons (char.valueOf) rest))) (define fold-right reduce) (define fold-left fold) diff --git a/dist/std.scm b/dist/std.scm index 8e168642b..dc2fd9896 100644 --- a/dist/std.scm +++ b/dist/std.scm @@ -2675,7 +2675,9 @@ Write object to standard output or give port. For strings it will include wrap in quotes." (let ((port (if (null? rest) (current-output-port) (car rest)))) - (display (repr obj true) port))) + (if (binary-port? port) + (display obj port) + (display (repr obj true) port)))) ;; ----------------------------------------------------------------------------- (define (write-char char . rest) diff --git a/dist/std.xcb b/dist/std.xcb index 1e413641c..154273726 100644 Binary files a/dist/std.xcb and b/dist/std.xcb differ diff --git a/lib/R5RS.scm b/lib/R5RS.scm index 150ef8dd2..fbd05997c 100755 --- a/lib/R5RS.scm +++ b/lib/R5RS.scm @@ -1104,7 +1104,9 @@ Write object to standard output or give port. For strings it will include wrap in quotes." (let ((port (if (null? rest) (current-output-port) (car rest)))) - (display (repr obj true) port))) + (if (binary-port? port) + (display obj port) + (display (repr obj true) port)))) ;; ----------------------------------------------------------------------------- (define (write-char char . rest)