l...@gnu.org (Ludovic Courtès) writes: >>> Mark also wrote: >>> Better yet, maybe it should be an optional attribute of the output port, >>> which would allow pretty-print and truncated-print to use it as well. >>> Output ports attached to terminals could determine the terminal width >>> from the OS, on systems that support it. > > I like the idea of using the terminal’s width, but I dislike the idea of > having it a property of the port, since it really seems orthogonal to > me.
I agree that it's not a perfect solution, but can you propose a better one that might reasonably be adopted in practice? Unfortunately, if we punt on this for want of perfection, we're likely to end up with a nearly pessimal solution: each individual module that needs to format output for fixed-width character displays will end up with its own half-baked solution, such as the one just applied. Ports are already very far from the simple and elegant ideas that comprise most of Scheme, and they already include much functionality that should be orthogonal. Which is worse? To add one more optional attribute to ports, or to have several inconsistent and inflexible notions of terminal width floating around the rest of the system? Mark