rzel / kahlua

Automatically exported from code.google.com/p/kahlua
0 stars 0 forks source link

incomplete implementation of string.format #6

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
the current implementation of format() method has all the basics but none
of the extra formatting options as described in C's sprintf method 

in one of my usecases i needed the number padding format, so i implemented
that and started preliminary work on proper implementation of those extra
parameters; however, i never got around to finishing it.

the patch is attached. it's vastly incomplete, has no test coverage etc.,
but it works (most of the time, at least).
if i continue, i'll be updating it.
otherwise, somebody please take care of it ;e))

Original issue reported on code.google.com by matej...@gmail.com on 12 Jan 2009 at 1:23

Attachments:

GoogleCodeExporter commented 8 years ago
Good point. I'll review the patch and hopefully implement enough test cases to 
verify
it within the next few days.

Thanks!

Original comment by kristofer.karlsson@gmail.com on 16 Jan 2009 at 6:08

GoogleCodeExporter commented 8 years ago
I have now commited some changes to string.format, including proper precision,
padding and some more stuff I found at
http://www.cplusplus.com/reference/clibrary/cstdio/sprintf.html
(not all of it though)
I have also added test cases that I hope cover all of the stuff I implemented.

I did not copy your patch verbatim, but I took a look at it and reused most of 
the
flow logic.
Do you want your name attached to the source code, if so, what should I write?

Original comment by kristofer.karlsson@gmail.com on 19 Jan 2009 at 10:10

GoogleCodeExporter commented 8 years ago
thanks.
no, i don't think i want to take credit for code i didn't write ;e)

Original comment by matej...@gmail.com on 19 Jan 2009 at 11:20