[m-dev.] for review: string__fmt
Peter Ross
peter.ross at miscrit.be
Fri Aug 11 18:52:09 AEST 2000
On Fri, Aug 11, 2000 at 02:51:00PM +1000, Fergus Henderson wrote:
> On 10-Aug-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> >
> > Apart from that, this looks fine now.
>
> Sorry, I spoke a little to soon.
> There are several things that still need to be fixed:
>
> - It needs to pass the test cases.
> Currently the string__format test cases are failing.
>
> - If the changes are sufficiently large that they might reasonably
> be expected to cause backwards compatibility problems, then
> even though interface design principles suggest we should only
> have one string formatting function, the way we should achieve
> that while retaining backwards compatibility is to give the
> new code a new name and to deprecate the old version,
> giving it a `pragma obsolete' declaration, rather than
> removing it. (Sorry I wasn't clear about this earlier.)
> As I understand things, the changes to string__format are indeed
> such that they might well cause backwards compatiblity problems
> for our existing users. Is that correct?
>
Having now done all the test cases, and seeing some of the generated
output, I believe that we should remove the support for string__format
as it was still buggy. In particular the second example is pretty nasty.
I am sure that there are other bugs in there as well.
Some examples:
string__format("%6.3g\n", [f(3.0 / 4.0)]) = "0" now "0.75"
string__format("%0 -10.5i", [i(-31)]) = "-000310000" now "-00031 "
One alternative would be to rename the new string__format to
string__fmt. This would at least alert the users that the interface has
changed.
Pete
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to: mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions: mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------
More information about the developers
mailing list