Pretty-printer

53 views
Skip to first unread message

Christoffer Sawicki

unread,
May 8, 2013, 6:38:23 PM5/8/13
to program...@googlegroups.com
Hello!

Does anybody have a pretty-printer for Nu S-expressions lying around?

Something like http://docs.racket-lang.org/reference/pretty-print.html would be awesome. :)

Regards,
Christoffer

Tim

unread,
May 10, 2013, 12:11:54 AM5/10/13
to program...@googlegroups.com
Hi Christoffer,


I use it constantly, mainly from within Textmate.

Tim

Christoffer Sawicki

unread,
May 10, 2013, 12:26:19 PM5/10/13
to program...@googlegroups.com
No, I had missed NuBeautifier in my search after NuPrettifier! :-)

However, NuBeautifier isn't exactly what I'm searching for: it handles indentation but doesn't decide where the line breaks go. (I need it for formatting data undecorated by humans.)

Example with Racket's pretty-write:

(pretty-write '(track (artist "Electric Moon") (album "The Doomsday Machine") (number 3) (name "Spaceman")))
; =>
(track
 (artist "Electric Moon")
 (album "The Doomsday Machine")
 (number 3)
 (name "Spaceman"))

Thanks!

Best regards,
Christoffer
Reply all
Reply to author
Forward
0 new messages