Re: [racket-users] Help with pretty printing

2019-04-04 Thread 'John Clements' via Racket Users
I’m glad to hear it! I think that it may not fail in nice ways for deeply nested s-expressions, but that not be an issue for you. I do think that there should be a nicer way than using a text%. John > On Apr 4, 2019, at 11:14 AM, Stephen Foster wrote: > > Thanks, John. Actually, when you

Re: [racket-users] Help with pretty printing

2019-04-04 Thread Stephen Foster
Thanks, John. Actually, when you distinguished between the line breaks and the indentation, that helped me come up with the following algorithm. It basically, 1) lets pretty-print do its thing (inserting more line breaks than I need), 2) uses a regex to scrub out all line breaks after a

[racket-users] Help with pretty printing

2019-04-02 Thread Stephen Foster
Hi all, Suppose, I have a datum that represents valid racket code, like '(test #:a a #:b b #: c). I'd love to render (arbitrarily deeply nested) datums like this to a string that displays like this: (test #:a a #:b b #:c c) Pretty printing almost works: (displayln (pretty-format