;; Venue is (make-vnu String (listof Streetway))
;; interp. a venue name and streetways leading from that venue
(@htdd Streetway)
(define-struct sw (nm dst))
;; Streetway is (make-sw String Venue)
;; interp. (make-s
...
;; Venue is (make-vnu String (listof Streetway))
;; interp. a venue name and streetways leading from that venue
(@htdd Streetway)
(define-struct sw (nm dst))
;; Streetway is (make-sw String Venue)
;; interp. (make-sw s v) is a streetway s that leads to the destination venue v.
(define M0
(shared ([-AHB- (make-vnu "Anti-Hero 13 Boutique" (list))]
[-RR- (make-vnu "Rocket Reprographics"
(list (make-sw "Cordova Eastbound" -AHB-)))]
[-VFS- (make-vnu "Vancouver Film School"
(list (make-sw "Hastings Westbound" -WTFD-)
(make-sw "Homer Northbound" -RR-)))]
[-WTFD- (make-vnu "WOW Tasty Food Delivery"
(list (make-sw "Hastings Eastbound" -VFS-)))])
(list -AHB- -RR- -VFS- -WTFD-)))
;; Online students: complete the following as your lab foundation.
;; On-ground students: complete the following as your pre-lab.
;; The incomplete data definition can represent venues and
;; streetways in Vancouver or anywhere else. Using the given example as
;; a guide, define an example of your own that includes AT LEAST the venues
;; and streetways in the block that spans from Richards to Hamilton and from
;; Dunsmuir to Hastings (there are 9 venues and 17 streetways in that block).
;; The provided examples are encapsulated, so they should not
;; interfere with your definition. DO NOT REUSE THE GIVEN EXAMPLE TO
;; DEFINE YOURS.
;;
;; Then complete the data definition by writing a template for the given data
;; definitions. DO NOT ADD ACCUMULATORS, simply produce the template
;; that corresponds to the type comments. You may encapsulate them
;; under the name fn-for-map, which takes a venue as its argument.
(define (fn-for-map v0)
(local [(define (fn-for-venue v)
(... (vnu-nm v)
(fn-for-losw (vnu-los v))))
(define (fn-for-losw losw)
(cond [(empty? losw) (...)]
[else
(... (fn-for-sw (first losw))
(fn-for-losw (re
[Show More]