(define desc ; TYPE: (-> (s-expression) (tree symbol)) (lambda (s) ; ENSURES: (eval result) = s (cond ((atom? s) (if (self-describing? s) s (list 'quote s))) (else (list 'cons (desc (car s)) (desc (cdr s))))))) (define self-describing? ; TYPE: (-> (atom) boolean) (lambda (a) (and (not (null? a)) ; () is sometimes a boolean (or (number? a) (boolean? a) (string? a))))) (define atom? ; TYPE: (-> (datum) boolean) (lambda (x) (not (pair? x))))