13 Sep
2008
13 Sep
'08
15:54
You would be able to get it down to:
'(foo syntax 1) (foo . #'1)
Dunno about the reason. If you wanted, you could try this simple, unfinished and unpolished printer instead: (define (pretty-print x) (cond ((symbol? x) (display x) (display " ")) ((string? x) (display (list #\" x #\" #\space))) ((pair? x) (display #\() (let lp ((x x)) (pretty-print (car x)) (let ((d (cdr x))) (cond ((null? d) (display #\))) ((pair? d) (lp d)) (else (display #\.) (pretty-print d)))))) ((null? x) (display #\() (display #\))) ((number? x) (display x) (display #\space)) (else (error "don't know type of:" x))))