[plt-scheme] pretty-print not so pretty

From: Kyle Smith (airfoil at bellsouth.net)
Date: Thu Jan 18 10:22:40 EST 2007

Hi folks,

What I'm after is to display the application, whence a result came from; 
this was my attempt:

(require (lib "pretty.ss"))

(define-syntax (phere stx)
  (syntax-case stx ()
    ((_ app ...) #'(begin (pretty-display 'app ...) app ...))))
(phere (let ([x 0])
         (let ([y 1])
           (display (+ y x)))))

Welcome to DrScheme, version 369.3-svn8jan2007.
Language: Pretty Big (includes MrEd and Advanced Student).
(let ((x 0)) (let ((y 1)) (display (+ y x))))
While it functionally did what I wanted, it didn't show the code as I expected:
(let ((x 0))
  (let ((y 1))
     (display (+ y x))))

I've never used pretty-print before, but I thought it was supposed to display the sexp's in some kind-of reasonably acceptable standard way, not just a straight run of text.  I tried with both pretty-print and pretty-display, as  shown above.  I tried it in MzScheme with the same result.  Am I missing a parameter that needs setting, or some larger concept?



Kyle Smith
airfoil at bellsouth dot net

Posted on the users mailing list.