We can use define to give a signature form (the way in which student
languages support type annotation) a name:
(define WeekDay (signature (enum "Mon" "Tue" "Wed" "Thu" "Fry" "Sat" "Sun")))
Since such definitions correspond to data (type) definitions in HtDP,
it would be convenient to have a variant of define that does not
need an explicit signature. Thus, the above definition could be
written as:
(define-type WeekDay (enum "Mon" "Tue" "Wed" "Thu" "Fry" "Sat" "Sun"))
We can use
defineto give a signature form (the way in which studentlanguages support type annotation) a name:
Since such definitions correspond to data (type) definitions in HtDP,
it would be convenient to have a variant of
definethat does notneed an explicit
signature. Thus, the above definition could bewritten as: