我正在为一个班做家庭作业。问题陈述说要使用数据定义:
(define-struct diff-exp exprs)
(define-struct mult-exp exprs)
;; An Expr is one of
;; -- Number
;; -- (make-diff-exp (cons Expr LOExpr))
;; -- (make-mult-exp (cons Expr LOExpr))
;; Interpretation: a diff-exp represents a difference,
;; and a mult-exp represents a multiplication.
;; A List of Exprs (LOExpr) is one of
;; -- empty
;; -- (cons Expr LOExpr)
然而,当我在资料来源中只有这一点时,Scheme博士(中级学生语言)说:
define-struct: expected a sequence of field names after the structure type name in `define-struct', but found something else
这里是否有我遗漏的东西,或者我的老师给了我一个无效的数据定义?