small refactoring on <record-type>
This commit is contained in:
parent
9316ba468b
commit
0f89e04548
|
@ -748,18 +748,18 @@
|
||||||
|
|
||||||
(import (picrin record))
|
(import (picrin record))
|
||||||
|
|
||||||
(define <record-type>
|
(define <record-type> #t) ; bootstrap
|
||||||
(let ((<record-type> (make-record #t))) ; bootstrap
|
|
||||||
(let ((type-type (make-record <record-type>)))
|
|
||||||
(record-set! <record-type> '@@type type-type)
|
|
||||||
(record-set! type-type 'name '<record-type>)
|
|
||||||
<record-type>)))
|
|
||||||
|
|
||||||
(define (make-record-type name)
|
(define (make-record-type name)
|
||||||
(let ((rectype (make-record <record-type>)))
|
(let ((rectype (make-record <record-type>)))
|
||||||
(record-set! rectype 'name name)
|
(record-set! rectype 'name name)
|
||||||
rectype))
|
rectype))
|
||||||
|
|
||||||
|
(set! <record-type>
|
||||||
|
(let ((<record-type> (make-record-type '<record-type>)))
|
||||||
|
(record-set! <record-type> '@@type <record-type>)
|
||||||
|
<record-type>))
|
||||||
|
|
||||||
(define-syntax define-record-constructor
|
(define-syntax define-record-constructor
|
||||||
(ir-macro-transformer
|
(ir-macro-transformer
|
||||||
(lambda (form inject compare?)
|
(lambda (form inject compare?)
|
||||||
|
|
Loading…
Reference in New Issue