;; Unions and list of structs ;; TODO: create the following structures: ;; --DVD has a director, title, length ;; --Book has a author, title, num-pages ;; --CD has an artist, title, num-tracks, length ;; TODO: create a template for Media that takes one of the structures we've defined ;; Create a function, get-author, that when given a form of media(cd,dvd,or book) returns the ;; name(artist,director,or author) and title of the media as a string seperated by a space ;;examples: ;; (get-author (make-book "joe" "lucky" 100)) => "joe lucky" ;; Create a function, title-length, which when given a form of media, returns the title of the media ;; and the length( or num-pages) of the media as a string seperated by a space ;; list-of-media ;; --empty ;; --(cons media list-of-media) ;; Create a function, list-author, which takes a list of media as input and for each item in the list ;; returns just the artist/director/author and title as a string followed by a space ;;examples: ;; (list-author (list (make-cd "ath" "titl" 12 100) (make-dvd "dir" "titl" 122) (make-book "auth" "titl" 121))) ;; => (list "ath title" "dir title" "auth titl")