(let* ((T ((fileVal "Set")(lambda (i j) (if (< i j) -1 (if (> i j) 1 0)))))) (let ((pr (lambda (s) (display s) (newline))) (cmpn (lambda s (let ac ((t s)) (if (null? t) (T 'empty) ((T 'add) (car t) (ac (cdr t)))))))) (let ((tlst '( 49 (elements (add 42 (add 42 empty))) (elements (add 38 (add 42 empty))) (elements ((T 'remove) 42 (add 38 (add 42 empty)))) (elements (singleton 31)) (elements (diff (singleton 11) (singleton 41))) (elements (cmpn 4 5 3 5 6)) (elements (diff (cmpn 3 6 4 8 33) (cmpn 8 42 6 33))) (elements (add 4 (cmpn 5 3 5 6))) (elements ((T 'union) (cmpn 20 24 33 11 5) (cmpn 24 11 36))) (elements ((T 'inter) (cmpn 20 24 33 11 5) (cmpn 24 11 36))) ((T 'fold) + empty 3) ((T 'fold) + (cmpn 20 24 33 11 5) 3) ((T 'fold) cons (cmpn 20 24 33 11 5) ()) (let ((x ((T 'split) 23 (cmpn 20 24 33 11 5)))) (list (elements (car x)) (cadr x) (elements (caddr x)))) ((T 'compare) (cmpn 20 24 33 11 5) (cmpn 33 24 11 5 20)) ((T 'equal) (cmpn 20 24 33 12 5) (cmpn 33 24 12 5 20)) (elements ((T 'filter) odd? (cmpn 20 24 33 12 5))) ((T 'for_all) odd? (cmpn 20 24 33 12 5)) ((T 'exists) negative? (cmpn 20 24 33 12 5)) (let ((x ((T 'partition) odd? (cmpn 2 5 6)))) (list (elements(car x))(elements(cdr x)))) ))) (map (lambda (te) (pr (list te "=>" (eval `(let* ( (T ,T)(cmpn ,cmpn)(elements ,(T 'elements)) (empty (T 'empty))(add (T 'add))(singleton (T 'singleton))(iter (T 'iter)) (diff (T 'diff))) ,te) (scheme-report-environment 5))))) tlst) )))