From: Chris Hanson Date: Sat, 12 May 2018 06:20:14 +0000 (-0700) Subject: Remove unneeded environment arguments from various printers. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~64 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=f1c07f1f4b395a35b7a451327f117b72274a6d62;p=mit-scheme.git Remove unneeded environment arguments from various printers. --- diff --git a/src/edwin/intmod.scm b/src/edwin/intmod.scm index 7adec4590..2a8d5623e 100644 --- a/src/edwin/intmod.scm +++ b/src/edwin/intmod.scm @@ -904,7 +904,7 @@ If this is an error, the debugger examines the error condition." (and (not (null? windows)) (apply min (map window-x-size windows))))))) -(define (operation/write-result port expression value hash-number environment) +(define (operation/write-result port expression value hash-number) (let ((buffer (port/buffer port)) (other-buffer? (memq (operation/current-expression-context port expression) @@ -915,7 +915,7 @@ If this is an error, the debugger examines the error condition." (and (ref-variable enable-transcript-buffer buffer) (transcript-buffer))) (begin - (default/write-result port expression value hash-number environment) + (default/write-result port expression value hash-number) (if (and other-buffer? (not (mark-visible? (port/mark port)))) (transcript-write value #f)))))) diff --git a/src/runtime/emacs.scm b/src/runtime/emacs.scm index 85cbb234a..6964c8c6c 100644 --- a/src/runtime/emacs.scm +++ b/src/runtime/emacs.scm @@ -123,7 +123,7 @@ USA. ;;;; Miscellaneous Hooks -(define (emacs/write-result port expression object hash-number environment) +(define (emacs/write-result port expression object hash-number) expression (cond ((undefined-value? object) (transmit-signal-with-argument port #\v "")) @@ -142,7 +142,7 @@ USA. port #\v (call-with-output-string (lambda (port) - (write object port environment))))))) + (write object port))))))) (define (emacs/error-decision repl condition) condition diff --git a/src/runtime/rep.scm b/src/runtime/rep.scm index ac769e27b..9b862ecb8 100644 --- a/src/runtime/rep.scm +++ b/src/runtime/rep.scm @@ -494,12 +494,17 @@ USA. with-repl-eval-boundary repl)) -(define (repl-write value s-expression #!optional environment repl) - (receive (environment repl) (optional-er environment repl 'repl-write) - (hook/repl-write value s-expression environment repl))) +(define (repl-write value s-expression #!optional repl) + (hook/repl-write value + s-expression + (if (default-object? repl) + (nearest-repl) + (begin + (guarantee repl? repl 'repl-write) + repl)))) (define hook/repl-write) -(define (default/repl-write object s-expression environment repl) +(define (default/repl-write object s-expression repl) (port/write-result (cmdl/port repl) s-expression object @@ -507,8 +512,7 @@ USA. (object-pointer? object) (not (interned-symbol? object)) (not (number? object)) - (hash-object object)) - environment)) + (hash-object object)))) (define (repl-eval/write s-expression #!optional environment repl) (receive (environment repl) (optional-er environment repl 'repl-eval/write) @@ -517,7 +521,6 @@ USA. (define (%repl-eval/write s-expression environment repl) (hook/repl-write (%repl-eval s-expression environment repl) s-expression - environment repl)) (define (optional-er environment repl caller) diff --git a/src/runtime/swank.scm b/src/runtime/swank.scm index 155c02a00..eff60c528 100644 --- a/src/runtime/swank.scm +++ b/src/runtime/swank.scm @@ -283,7 +283,7 @@ USA. (let ((value (repl-eval sexp socket))) (call-with-output-string (lambda (port) - (port/write-result port sexp value (hash-object value) (buffer-env)) + (port/write-result port sexp value (hash-object value)) (if nl? (newline port)))))) (define (for-each-sexp procedure string) diff --git a/src/runtime/usrint.scm b/src/runtime/usrint.scm index 63c4f6c54..adb8fe152 100644 --- a/src/runtime/usrint.scm +++ b/src/runtime/usrint.scm @@ -323,18 +323,13 @@ USA. ;;;; Miscellaneous Hooks -(define (port/write-result port expression value hash-number - #!optional environment) - (let ((operation (textual-port-operation port 'write-result)) - (environment - (if (default-object? environment) - (nearest-repl/environment) - (guarantee environment? environment 'port/write-result)))) +(define (port/write-result port expression value hash-number) + (let ((operation (textual-port-operation port 'write-result))) (if operation - (operation port expression value hash-number environment) - (default/write-result port expression value hash-number environment)))) + (operation port expression value hash-number) + (default/write-result port expression value hash-number)))) -(define (default/write-result port expression object hash-number environment) +(define (default/write-result port expression object hash-number) expression (if (not (nearest-cmdl/batch-mode?)) (with-output-port-terminal-mode port 'cooked @@ -349,9 +344,9 @@ USA. (if hash-number (begin (write-string " " port) - (write hash-number port environment))) + (write hash-number port))) (write-string ": " port) - (write object port environment))))))) + (write object port))))))) (define write-result:undefined-value-is-special? true)