CLIM mail archive

[Prev][Next][Index][Thread]

Re: format directives



    Date: Thu, 3 Sep 1992 11:20 PDT
    From: Steve Haflich <smh@franz.com>

       From: Scott McKay <SWM@stony-brook.scrc.symbolics.com>

	   The Lisp machine has open and close horseshoe as format directives to make
	   text style specifications easy.  Is there any thought on this subject for CLIM?

       Not to my knowledge.  I hope that we CLIM implementors all resist the
       temptation to mess around with FORMAT directives.  This is certainly
       good material for a CLIM library contribution, though.

	   I am about to use ~+ and ~- because they are about the only unused characters
	   that make any menonic sense.

    There's no portable way for CLIM or a library contribution portably to
    extend format string syntax.  The strategy of shadowing format with an
    extended version might make other implementation-dependent extensions
    unavailable.

    There is a portable way to approximate what's wanted using the `new'
    ~/.../ format directive -- something like ~/clim:push-font/ -- but it
    would be syntactically turgid in practice.

(with-font-face (:italic)
	(format t "Turgid?  "))
(format "How about ")
(with-font-face (:bold)
	(format t "something"))
(format "for people who want to use fonts?")

Now, that's turgid!  (And because it is so turgid, I bet you didn't notice
the problem with a missing space.)

One of my biggest frustrations from converting some Symbolics systems to
CLIM (on Suns) was the loss of just printing text that had fonts in it
already.  Well, someday these other systems will eventually catch up to
Symbolics (and Xerox before them).

But, if I at least had a format directive directive to switch faces (or
whatever), then the code would only be somewhat bloated but still mostly
readable.

As far as portability is concerned, all that should be hidden in
CLIM:FORMAT.  (I'm guessing that all implementations of CLIM require
you to use CLIM:FORMAT since the first arg might not be a CL:STREAM.)

0,,

Follow-Ups: References:

Main Index | Thread Index