Modify make-record-type to accept the print-method as an optional
authorGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Mon, 31 Jan 1994 02:49:45 +0000 (02:49 +0000)
committerGuillermo J. Rozas <edu/mit/csail/zurich/gjr>
Mon, 31 Jan 1994 02:49:45 +0000 (02:49 +0000)
argument.

v7/src/runtime/record.scm

index e9168bae753ee4ffb2745f268a8f5d1e85c59219..5d8521d55ec3e3c3b802024a05e46f7fda7ebca1 100644 (file)
@@ -1,8 +1,8 @@
 #| -*-Scheme-*-
 
-$Id: record.scm,v 1.21 1994/01/29 21:54:17 adams Exp $
+$Id: record.scm,v 1.22 1994/01/31 02:49:45 gjr Exp $
 
-Copyright (c) 1989-93 Massachusetts Institute of Technology
+Copyright (c) 1989-1994 Massachusetts Institute of Technology
 
 This material was developed by the Scheme project at the Massachusetts
 Institute of Technology, Department of Electrical Engineering and
@@ -114,7 +114,7 @@ MIT in each case. |#
    (primitive-object-set-type (ucode-type constant)
                              (primitive-object-ref record-type 0))))
 \f
-(define (make-record-type type-name field-names)
+(define (make-record-type type-name field-names #!optional print-method)
   (guarantee-list-of-unique-symbols field-names 'MAKE-RECORD-TYPE)
   (let ((record-type
         (%record record-type-type
@@ -127,6 +127,8 @@ MIT in each case. |#
     (add-to-population! record-type-population record-type)
     (if record-type-initialization-hook
        (record-type-initialization-hook record-type))
+    (if (not (default-object? print-method))
+       (set-record-type-unparser-method! record-type print-method))
     record-type))
 
 (define (record-type? object)