Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!mit-eddie!uw-beaver!uw-june!pattis
From: pattis@cs.washington.edu (Richard Pattis)
Newsgroups: comp.lang.ada
Subject: Re: integer'image
Summary: more parameters
Message-ID: <14613@june.cs.washington.edu>
Date: 22 Jan 91 21:37:18 GMT
References: <2563@sparko.gwu.edu> <10140@as0c.sei.cmu.edu> <2584@sparko.gwu.edu>
Organization: U of Washington, Computer Science, Seattle
Lines: 25

And add a parameter that allows padding to be a ' ' or '0' or any other
aribtrary character. For printing times, I want 12:05:07.

I think what this series of posts finally has lead to the conclusion
that everyone wants slightly different variants of the  INTEGER => STRING
conversion function.  All can be written easily, given INTEGER'IMAGE; yes,
some might be written a bit more easily if the ' ' wasn't added at the
front of non-negative numbers (but I don't claim to have any arguments
for or against).

This "problem" disappears one abstraction level up.  I can't think of
the last time I used INTEGER'IMAGE in my code (I mostly use an overloaded
& to catenate strings and numeric values, or when special formatting is
required, my own formatting routines).

I don't care what INTEGER'IMAGE does; it might be useful to have a nice
package of INTEGER => STRING functions, including conversions to roman
numerals and english: "XXVII" and "TWENTY SEVEN".

Let's get back to convincing Ada compiler developers that they can all
get rich by selling cheaply priced student compilers (and then make even
more money by selling these students special packages that perform such
conversions).

Rich Pattis