Computer Science > STUDY GUIDE > University of British Columbia - CPSC 110lab-11 solution cpsc 110. (All)
;; 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 (rest losw)))])) [Show More]
Last updated: 2 years ago
Preview 1 out of 4 pages
Buy this document to get the full access instantly
Instant Download Access after purchase
Buy NowInstant download
We Accept:
Can't find what you want? Try our AI powered Search
Connected school, study & course
About the document
Uploaded On
Apr 08, 2021
Number of pages
4
Written in
This document has been written for:
Uploaded
Apr 08, 2021
Downloads
0
Views
70
In Scholarfriends, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Scholarfriends · High quality services·