fix: make define-record-equality!
a definition
This commit is contained in:
parent
bdfa3d60ff
commit
164cf8fba3
1 changed files with 3 additions and 1 deletions
|
@ -6,6 +6,8 @@
|
|||
(define-syntax define-record-equality!
|
||||
(syntax-rules ()
|
||||
[(_ record-type-name)
|
||||
;; pointless definition ensures that you can do (begin (define) (define-record-equality!) (define))
|
||||
(define _
|
||||
(let ()
|
||||
(define rtd (record-type-descriptor record-type-name))
|
||||
(define field-count (vector-length (record-type-field-names rtd)))
|
||||
|
@ -17,7 +19,7 @@
|
|||
(lambda (r1 r2 =)
|
||||
(for-all
|
||||
(lambda (accessor) (= (accessor r1) (accessor r2)))
|
||||
accessors))))]
|
||||
accessors)))))]
|
||||
[(_ name name* ...)
|
||||
(begin (define-record-equality! name)
|
||||
(define-record-equality! name*) ...)]))
|
||||
|
|
Loading…
Reference in a new issue