Front page | perl.perl6.internals |
Postings from December 2001
From: Brent Dax
December 20, 2001 22:02
Message ID: FJELLKOPEAGHOOODKEDPKELOCOAA.firstname.lastname@example.org
The attached patch implements a Parrot_sprintf function. It doesn't do
quite what you think--it just wraps the system sprintf. However, it
provides I and F sizes and is designed to interact with STRINGs. For
Parrot_sprintf(&str, "Decimal: %Id\nOctal: %Io\nDecimal: %Ff\nExponent:
%Fe", i, i, f, f);
It keeps away from messing up flags--%+3.2Ff will do what it should.
However, it has one big weakness. Currently, you'll get a buffer
overflow if the resulting string is greater than 1024 characters.
The patch doesn't actually change anything to use Parrot_sprintf; it
just defines the function and the Configure machinery needed to support
it. It's currently in string.[hc]; I'm not sure if this is the right
place. I won't be surprised if this isn't high-quality enough to
actually be applied.
Configure pumpking for Perl 6
"Nothing important happened today."
--George III of England's diary entry for 4-Jul-1776
by Brent Dax