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

Extending format strings.



I want to be able to print floating point numbers in Dylan.  The format and
format-out methods don't do this by default.  There's some verbiage about
overriding print-message and using %S, but I can't quite figure out how to
make this work.  (For starters it looks like print-message is sealed.)  I
have, as a result, a few questions whose answers may save me some irritating
exploratory surgery:

1) Is this correct?  Do I have to use %S and a custom method dispatched by
type?  Is there any way to add new formatting characters to the control
string so I can use the more familiar %f et al suite?

2) How do I add print-message methods when it looks like print-message is
sealed?

3) What is the footprint of print-message anyway?  The docs say that
print-message has two arguments but don't actually provide the order of
arguments, etc. in any clear fashion.

4) Another candidate seems to be to use %= and print-object instead.  Is
this correct or is print-object used for something completely different?





Follow-Ups: