dev-elider-3
Matthew Butterick 9 years ago
parent b7286f208c
commit 7dd003deff

@ -31,8 +31,8 @@
(define #'(define-datatype <base-type> <base-type-predicate?>
(<subtype> [<field> <field-predicate?>] ...) ...)
#'(begin
(struct <base-type> () #:transparent)
(struct <subtype> <base-type> (<field> ...) #:transparent
(struct <base-type> () #:transparent #:mutable)
(struct <subtype> <base-type> (<field> ...) #:transparent #:mutable
#:guard (λ(<field> ... name)
(unless (<field-predicate?> <field>)
(error name (format "arg ~a is not ~a" <field> '<field-predicate?>))) ...

Loading…
Cancel
Save