|
|
@ -28,15 +28,15 @@
|
|
|
|
(values rator rand))))
|
|
|
|
(values rator rand))))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define #'(define-datatype <base-type> <base-type-predicate?>
|
|
|
|
(define #'(define-datatype _base-type _base-type-predicate?
|
|
|
|
(<subtype> [<field> <field-predicate?>] ...) ...)
|
|
|
|
(_subtype [_field _field-predicate?] ...) ...)
|
|
|
|
#'(begin
|
|
|
|
#'(begin
|
|
|
|
(struct <base-type> () #:transparent #:mutable)
|
|
|
|
(struct _base-type () #:transparent #:mutable)
|
|
|
|
(struct <subtype> <base-type> (<field> ...) #:transparent #:mutable
|
|
|
|
(struct _subtype _base-type (_field ...) #:transparent #:mutable
|
|
|
|
#:guard (λ(<field> ... name)
|
|
|
|
#:guard (λ(_field ... name)
|
|
|
|
(unless (<field-predicate?> <field>)
|
|
|
|
(unless (_field-predicate? _field)
|
|
|
|
(error name (format "arg ~a is not ~a" <field> '<field-predicate?>))) ...
|
|
|
|
(error name (format "arg ~a is not ~a" _field '_field-predicate?))) ...
|
|
|
|
(values <field> ...))) ...))
|
|
|
|
(values _field ...))) ...))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
(define-datatype lc-exp lc-exp?
|
|
|
|
(define-datatype lc-exp lc-exp?
|
|
|
|