David Lichteblau david@lichteblau.com writes:
Well, no. I see the following kinds of streams:
[nice sumamry deleted]
more general stream-like objects which don't involve such a buffer
An example would be CLIM, which takes the Common Lisp API for streams with similar purposes but a completely different implementation. A buffer of bytes would not help for such streams at all, yet re-using the existing stream API appears better than reinventing it.
I suspect that a credible GSLO extension interface has to have significantly more hookage into the pretty printer than Gray streams do, simpy to allow things like pretty printing with proportional fonts. Note that this would probably break the "write-to-string/render" equivalence that user of monospaced Lisps have grown to expect. For example,
(format stream format-specifier arg ...)
and
(write-sequence (format nil format-specifier arg ...) stream)
would, when sufficiently complicated tabulation/indentation/logical block constructs are in use, line up differently: in a sane world, the "current font" would be a per-stream attribute, so there's no way for (format nil ...) to know what the font metrics are.
(That's leaving aside the infelicities of the stream interface for non-English applications (e.g. l->r rendering assumptions, format ~p, ~@p directives) about which I'm mostly not qualified to speculate.)
-dan