Guest User

Untitled

a guest
Apr 21st, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. ;2
  2. (define-struct book (author title section price))
  3. ;;Constructor
  4. ;;book: string string string number -> book
  5.  
  6. ;;Selectors
  7. ;;book author: book->string
  8. ;;book title: book-> string
  9. ;;book section: book-> string
  10. ;;book price:book -> price
  11.  
  12. ;predicates
  13. ;;;book?: any-> boolean
  14.  
  15. (define Beautiful-Creatures (make-book "Kami Garcia & Margaret Stohl"
  16. "Beautiful Creatures" "young adult" 8.99))
  17. (define Rainwater (make-book "Sandra Brown" "Rainwater" "romance" 7.99))
  18. (define Host (make-book "Stephanie Meyer" "The Host" "suspense" 15.00))
  19. (define Colors (make-book "Doris Mortman" "True Colors" "young adult" 12.99))
Add Comment
Please, Sign In to add comment