New draft (#3) of SRFI 272: Pretty Printing Arthur A. Gleckler (21 Sep 2026 18:44 UTC)
Re: New draft (#3) of SRFI 272: Pretty Printing Sergei Egorov (21 Sep 2026 19:01 UTC)
dynamic pretty-printing Per Bothner (21 Sep 2026 21:26 UTC)
Re: dynamic pretty-printing Sergei Egorov (22 Sep 2026 04:42 UTC)

dynamic pretty-printing Per Bothner 21 Sep 2026 21:26 UTC

Kawa has an unique (?) feature in that it can defer line-breaking and
indentation to a suitable terminal (specifically DomTerm). If the
terminal changes line width, the output is re-formatted - even for output
from previous commands - even if the kawa command has finished running.

You can see it in action here: https://domterm.org/saved/dt-prettynested.html
Try changing the window width. You can also click triangles to show/hide sections.
This is a transcript of a terminal session, but with embedded control
sequences to mark blocks, soft line-breaks (multiple kinds, as in Common Lisp),
and indentation. Some Javascript code does the actual line-breaking.
This line-breaking is normally in the context of an actual "live" terminal session,
but can also be done (as in the demo) in a "saved" session ("transcript").

Here is an old blog article: https://per.bothner.com/blog/2017/dynamic-prettyprinting/

It would be nice if SRFI-272 could make use of these facilities.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/