Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;2
- (define-struct book (author title section price))
- ;;Constructor
- ;;book: string string string number -> book
- ;;Selectors
- ;;book author: book->string
- ;;book title: book-> string
- ;;book section: book-> string
- ;;book price:book -> price
- ;predicates
- ;;;book?: any-> boolean
- (define Beautiful-Creatures (make-book "Kami Garcia & Margaret Stohl"
- "Beautiful Creatures" "young adult" 8.99))
- (define Rainwater (make-book "Sandra Brown" "Rainwater" "romance" 7.99))
- (define Host (make-book "Stephanie Meyer" "The Host" "suspense" 15.00))
- (define Colors (make-book "Doris Mortman" "True Colors" "young adult" 12.99))
Add Comment
Please, Sign In to add comment