Blob


1 ;; The first three lines of this file were inserted by DrScheme. They record metadata
2 ;; about the language level of this file in a form that our tools can easily process.
3 #reader(lib "htdp-intermediate-reader.ss" "lang")((modname 18.1.11) (read-case-sensitive #t) (teachpacks ((lib "draw.ss" "teachpack" "htdp"))) (htdp-settings #(#t constructor repeating-decimal #f #t none #f ((lib "draw.ss" "teachpack" "htdp")))))
4 (define-struct star (name instrument))
6 A star is a structure
7 (make-star name instrument)
8 where both name and instrument are symbols.
10 (define alos
11 (list (make-star 'Chris 'saxophone)
12 (make-star 'Robby 'trumpet)
13 (make-star 'Matt 'violin)
14 (make-star 'Wen 'guitar)
15 (make-star 'Matt 'radio)))
17 last-occurrence : symbol list-of-star -> star
18 Given a-name and a-los, find the last occurrence of a star with a-name in the name field and return this star structure.
20 (define (last-occurrence a-name a-los)
21 (cond
22 []
23 []))