Reference 球拍:定义类型引用
我试图使用define type为引用编译合适的代数数据类型:Reference 球拍:定义类型引用,reference,racket,algebraic-data-types,Reference,Racket,Algebraic Data Types,我试图使用define type为引用编译合适的代数数据类型: Books: Author. Title. Publisher, City Year Articles from Magazines: Author. Title. Name of Magazine, Year Conference Contributions: Author. Title. Name of Conference. Publisher, City Year 不幸的是,我不知道
Books: Author. Title. Publisher, City Year
Articles from Magazines: Author. Title. Name of Magazine, Year
Conference Contributions: Author. Title. Name of Conference. Publisher, City Year
不幸的是,我不知道如何处理这个问题。虽然我知道define type的特性以及它与define struct的区别
谁能给我指出正确的方向吗?非常感谢 假设
定义类型
指的是htdp2/抽象
中的定义类型
:
(define-type reference
(book (author string?) (title string?) (publisher string?) (city string?) (year number?))
(magazine-article (author string?) ...etc...)
(conference-contribution (author string?) ...etc...))