From a9e84c522a0da6c6ce8a5bcb623c1a112ceec877 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 5 Jan 2019 17:52:10 -0800 Subject: [PATCH] New printer parameter param:print-hash-number-in-objects?. --- src/runtime/boot.scm | 7 +++++-- src/runtime/printer.scm | 9 +++++++-- src/runtime/runtime.pkg | 1 + 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/runtime/boot.scm b/src/runtime/boot.scm index ea7e651b9..853dbd6e1 100644 --- a/src/runtime/boot.scm +++ b/src/runtime/boot.scm @@ -344,8 +344,11 @@ USA. (begin (write-string "#[" port) (display (if (procedure? name) (name object) name) port) - (write-char #\space port) - (write (hash-object object) port) + (if (or (param:print-hash-number-in-objects?) + (not printer)) + (begin + (write-char #\space port) + (write (hash-object object) port))) (if printer (printer object port)) (write-char #\] port))))) diff --git a/src/runtime/printer.scm b/src/runtime/printer.scm index 3cea685fd..960dc7e15 100644 --- a/src/runtime/printer.scm +++ b/src/runtime/printer.scm @@ -65,6 +65,9 @@ USA. (define-deferred param:printer-abbreviate-quotations? (make-unsettable-parameter #f boolean-converter)) +(define-deferred param:print-hash-number-in-objects? + (make-settable-parameter #t boolean-converter)) + (define-deferred param:printer-list-breadth-limit (make-unsettable-parameter #f limit-converter)) @@ -423,8 +426,10 @@ USA. (if (string? name) (*print-string name context*) (print-object name context*)) - (*print-char #\space context*) - (*print-hash object context*) + (if (param:print-hash-number-in-objects?) + (begin + (*print-char #\space context*) + (*print-hash object context*))) (cond (procedure (procedure context*)) ((get-param:print-with-datum?) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 1000c23ee..223ca788b 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -5035,6 +5035,7 @@ USA. (export () param:print-char-in-unicode-syntax? param:print-compound-procedure-names? + param:print-hash-number-in-objects? param:print-primitives-by-name? param:print-streams? param:print-uninterned-symbols-by-name? -- 2.25.1