New printer parameter param:print-hash-number-in-objects?.
authorChris Hanson <org/chris-hanson/cph>
Sun, 6 Jan 2019 01:52:10 +0000 (17:52 -0800)
committerChris Hanson <org/chris-hanson/cph>
Sun, 6 Jan 2019 01:52:10 +0000 (17:52 -0800)
src/runtime/boot.scm
src/runtime/printer.scm
src/runtime/runtime.pkg

index ea7e651b9153a06c4fbda18c968339a0cba3ffa1..853dbd6e1c823236ac81d6c915c824c556870af6 100644 (file)
@@ -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)))))
 
index 3cea685fd742f4c37373558492706c29fcdf0705..960dc7e15d4972555a06656a45e0a6d98fd81a74 100644 (file)
@@ -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?)
index 1000c23eec7dde98d58c1eb5877098d1315da8e9..223ca788bdc60b0c9949ba16275d1e65ff3f24fb 100644 (file)
@@ -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?