Delete some unnecessary procedures.
authorChris Hanson <org/chris-hanson/cph>
Thu, 11 Jan 2018 03:37:47 +0000 (19:37 -0800)
committerChris Hanson <org/chris-hanson/cph>
Thu, 11 Jan 2018 03:37:47 +0000 (19:37 -0800)
src/runtime/record.scm
src/runtime/runtime.pkg

index 0c2d0a8b458da622f4f95168fb76ab70842ce2c4..c10f25855e51037c9b9b131ffd8a5d0a09c5dfbb 100644 (file)
@@ -188,10 +188,6 @@ USA.
   (let ((v (%record-type-field-names record-type)))
     ((ucode-primitive subvector->list) v 0 (vector-length v))))
 
-(define (record-type-default-inits record-type)
-  (guarantee-record-type record-type 'RECORD-TYPE-DEFAULT-INITS)
-  (vector->list (%record-type-default-inits record-type)))
-
 (define (%valid-default-inits? default-inits n-fields)
   (fix:= n-fields (length default-inits)))
 
@@ -209,15 +205,12 @@ USA.
 (define (initialize-record-procedures!)
   (run-deferred-boot-actions 'record-procedures))
 
-(define (record-type-default-value record-type field-name)
-  (record-type-default-value-by-index
-   record-type
-   (record-type-field-index record-type field-name #t)))
-
-(define (record-type-default-value-by-index record-type field-name-index)
-  (let ((init (vector-ref (%record-type-default-inits record-type)
-                         (fix:- field-name-index 1))))
-    (and init (init))))
+(define (record-type-default-value-by-index record-type field-index)
+  (let ((init
+        (vector-ref (%record-type-default-inits record-type)
+                    (fix:- field-index 1))))
+    (and init
+        (init))))
 \f
 (define %record-type-predicate
   %record-type-tag)
@@ -513,10 +506,9 @@ USA.
    #f))
 
 (define-unparser-method record-type?
-  (standard-unparser-method 'record-type
-    (lambda (type port)
-      (write-char #\space port)
-      (display (%record-type-name type) port))))
+  (simple-unparser-method 'record-type
+    (lambda (type)
+      (list (%record-type-name type)))))
 
 (define-pp-describer %record?
   (lambda (record)
@@ -655,9 +647,6 @@ USA.
           (vector->list (structure-type/field-names type))
           (vector->list (structure-type/field-indexes type))))))
 
-(define (define-structure/default-value type field-name)
-  ((structure-type/default-init type field-name)))
-
 (define (define-structure/default-value-by-index type field-name-index)
   ((structure-type/default-init-by-index type field-name-index)))
 \f
index 06cedd4303286ba6439009cd7d8ce365c50c0d8a..4a590e06210b6d150c599fa6329007d132fdd00e 100644 (file)
@@ -3738,7 +3738,6 @@ USA.
          condition-type:slot-error
          condition-type:uninitialized-slot
          copy-record
-         define-structure/default-value
          define-structure/default-value-by-index
          define-structure/keyword-constructor
          define-structure/list-accessor
@@ -3759,8 +3758,6 @@ USA.
          record-keyword-constructor
          record-modifier
          record-predicate
-         record-type-default-inits
-         record-type-default-value
          record-type-default-value-by-index
          record-type-descriptor
          record-type-dispatch-tag