From: Chris Hanson Date: Tue, 9 Jan 2018 03:01:58 +0000 (-0500) Subject: Move dispatch-tag print method into gentag.scm. X-Git-Tag: mit-scheme-pucked-x11-0.3.1~7^2~393 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=bc59423ae53b26bfc957c1c3fdc61cb1507bc50c;p=mit-scheme.git Move dispatch-tag print method into gentag.scm. --- diff --git a/src/runtime/gentag.scm b/src/runtime/gentag.scm index f54fd29e9..2a4487ddf 100644 --- a/src/runtime/gentag.scm +++ b/src/runtime/gentag.scm @@ -49,6 +49,11 @@ USA. (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]")) diff --git a/src/runtime/record.scm b/src/runtime/record.scm index 3588c244a..71a20181f 100644 --- a/src/runtime/record.scm +++ b/src/runtime/record.scm @@ -524,7 +524,7 @@ USA. ;;;; Printing (define-unparser-method %record? - (standard-unparser-method 'record #f)) + (standard-unparser-method 'record #f)) (define-unparser-method record? (standard-unparser-method @@ -539,15 +539,6 @@ USA. (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 '())) @@ -564,10 +555,16 @@ USA. ,((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)) - + (define (set-record-type-entity-unparser-method! record-type method) (define-unparser-method (record-entity-predicate record-type) method))