(and (%record? object)
(eq? dispatch-tag-marker (%record-ref object 0))))
+(define-unparser-method dispatch-tag?
+ (simple-unparser-method 'dispatch-tag
+ (lambda (tag)
+ (list (dispatch-tag-contents tag)))))
+
(define-integrable dispatch-tag-marker
((ucode-primitive string->symbol) "#[dispatch-tag]"))
;;;; Printing
(define-unparser-method %record?
- (standard-unparser-method 'record #f))
+ (standard-unparser-method 'record #f))
(define-unparser-method record?
(standard-unparser-method
(write-char #\space port)
(display (%record-type-name type) port))))
-(define-unparser-method dispatch-tag?
- (simple-unparser-method 'dispatch-tag
- (lambda (tag)
- (list (dispatch-tag-contents tag)))))
-
-(define (set-record-type-unparser-method! record-type method)
- (define-unparser-method (record-predicate record-type)
- method))
-
(define-pp-describer %record?
(lambda (record)
(let loop ((i (fix:- (%record-length record) 1)) (d '()))
,((record-accessor type field-name) record)))
(record-type-field-names type)))))
+;;; These are for backwards compatibility:
+
+(define (set-record-type-unparser-method! record-type method)
+ (define-unparser-method (record-predicate record-type)
+ method))
+
(define (set-record-type-describer! record-type describer)
(define-pp-describer (record-predicate record-type)
describer))
-\f
+
(define (set-record-type-entity-unparser-method! record-type method)
(define-unparser-method (record-entity-predicate record-type)
method))