dd.set.tests

dd.set.tests - ; ; ; ; Some sample manipulations of sets....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
; Some sample manipulations of sets. ; Note that any true (non-#f) value is acceptable anywhere #t appears. ; The only difference between this and set.tests.scm is that all the calls ; to new-set have been replaced by calls to new-list-set or new-intvls-set. (define s1 (new-list-set '(7 2 13 11 6 3))) (member? 11 s1) ; should be #t (member? 12 s1) ; should be #f (elements s1) (define s2 (with-element 11 s1)) ; should be the same set as s1 (member? 11 s2) ; should be #t (member? 12 s2) ; should be #f (elements s2) (define s3 (with-element 12 s1)) ; one more element than s1 has (map (lambda (x) (member? x s3)) '(11 12 14)) ; should be (#t #t #f) (elements s3) (define s4 (new-intvls-set '(7 2 13 11 6 3))) ; the following should return (#f #t #t #f #f #t #t #f #f #f #t #f #t #f) (map (lambda (x) (member? x s4)) '(1 2 3 4 5 6 7 8 9 10 11 12 13 14)) (elements s4) (define s5 (with-element 2 s4)) ; should be the same set as s4 ; the following should return (#f #t #t #f #f #t #t #f #f #f #t #f #t #f)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

dd.set.tests - ; ; ; ; Some sample manipulations of sets....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online