Provide built-in `computer' record type for DMdA.
`chocolate-cookie' has been wildly unpopular, so we'll try this next semester. Also, clean up the `provide' forms for the chocolate cookies.
This commit is contained in:
parent
8611cd8731
commit
3f8b2e6ea2
|
@ -12,8 +12,7 @@
|
|||
check-expect check-within check-error check-member-of check-range
|
||||
check-property for-all ==> expect expect-within expect-member-of expect-range
|
||||
signature contract : define-contract -> mixed one-of predicate combined list-of
|
||||
number real rational integer natural boolean true false string symbol empty-list unspecific property
|
||||
chocolate-cookie)
|
||||
number real rational integer natural boolean true false string symbol empty-list unspecific property)
|
||||
(provide cons)
|
||||
(provide-and-document
|
||||
procedures
|
||||
|
|
|
@ -12,8 +12,7 @@
|
|||
check-expect check-within check-error check-member-of check-range
|
||||
check-property for-all ==> expect expect-within expect-member-of expect-range
|
||||
signature contract : define-contract -> mixed one-of predicate combined list-of
|
||||
number real rational integer natural boolean true false string empty-list unspecific property
|
||||
chocolate-cookie)
|
||||
number real rational integer natural boolean true false string empty-list unspecific property)
|
||||
(provide cons)
|
||||
(provide-and-document
|
||||
procedures
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
check-expect check-within check-error check-member-of check-range
|
||||
check-property for-all ==> expect expect-within expect-member-of expect-range
|
||||
signature contract : define-contract -> mixed one-of predicate combined
|
||||
number real rational integer natural boolean true false string empty-list property
|
||||
chocolate-cookie)
|
||||
number real rational integer natural boolean true false string empty-list property)
|
||||
(provide cons list)
|
||||
(provide-and-document
|
||||
procedures
|
||||
|
|
|
@ -8,8 +8,7 @@
|
|||
check-expect check-within check-error check-member-of check-range
|
||||
check-property for-all ==> expect expect-within expect-member-of expect-range
|
||||
signature contract : define-contract -> mixed one-of predicate combined list-of
|
||||
number real rational integer natural boolean true false string empty-list property
|
||||
chocolate-cookie)
|
||||
number real rational integer natural boolean true false string empty-list property)
|
||||
(provide cons)
|
||||
(provide-and-document
|
||||
procedures
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
boolean true false
|
||||
string symbol
|
||||
empty-list
|
||||
chocolate-cookie
|
||||
unspecific
|
||||
property)
|
||||
|
||||
|
@ -274,7 +273,23 @@
|
|||
(reverse ((list %a) -> (list %a))
|
||||
"Liste in umgekehrte Reihenfolge bringen"))
|
||||
|
||||
("Computer"
|
||||
(computer signature
|
||||
"Signatur für Computer")
|
||||
(make-computer (string rational rational -> computer)
|
||||
"Computer aus Prozessorname, Arbeitsspeicher und Festplattenkapazität konstruieren")
|
||||
(computer? (%a -> boolean)
|
||||
"feststellen, ob Wert ein Computer ist")
|
||||
(computer-processor (computer -> string)
|
||||
"Prozessorname aus Computer extrahieren")
|
||||
(computer-ram (computer -> rational)
|
||||
"Arbeitsspeicher aus Computer extrahieren")
|
||||
(computer-hard-drive (computer -> rational)
|
||||
"Festplattenkapazität aus Computer extrahieren"))
|
||||
|
||||
("Schokokekse"
|
||||
(chocolate-cookie signature
|
||||
"Signatur für Schokokekse")
|
||||
(make-chocolate-cookie (number number -> chocolate-cookie)
|
||||
"Schokokeks aus Schoko- und Keks-Anteil konstruieren")
|
||||
(chocolate-cookie? (%a -> boolean)
|
||||
|
@ -850,6 +865,12 @@
|
|||
make-chocolate-cookie chocolate-cookie?
|
||||
(chocolate-cookie-chocolate chocolate-cookie-cookie))
|
||||
|
||||
(define-record-procedures computer
|
||||
make-computer computer?
|
||||
(computer-processor
|
||||
computer-ram
|
||||
computer-hard-drive))
|
||||
|
||||
(define (violation text)
|
||||
(error text))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user