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 07:30:38 +0000 (23:30 -0800)
src/runtime/boot.scm
src/runtime/printer.scm
src/runtime/runtime.pkg

index 99f2749816d713e52d0998d6b0e322d7768f85c4..ecc79ac1fe88b8f32017ce1456ea8cf7fe4a2170 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 32f39b2361172fffc79671c0457443017b239013..125ffaef669048e7bb7bd610e3639d73dcb022a2 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))
 
@@ -422,8 +425,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 d241fb8dbbd58d24539460c447ec8433be44e10f..fc9eac3032de9204d7d9240691b18073561154ea 100644 (file)
@@ -4926,6 +4926,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?