In article <jcau0q$l88$
1...@dont-email.me>,
Aharon Robbins <
arn...@skeeve.com> wrote:
>In article <jc77ce$2kk$
1...@news.xmission.com>,
>Kenny McCormack <
gaz...@shell.xmission.com> wrote:
>>In article <
201112122...@webuse.net>,
>>Ed Morton <
morto...@gmail.com> wrote:
>>...
>>>That is odd. On Solaris SunOS 5.10 I get:
>>>
>>>$ LANG=en_US gawk 'BEGIN {printf "%\047ld\n",0123456789}'
>>>123,456,789
>>
>>Interestingly enough, it does the right thing in gawk4, but not in gawk
>>3.1.4. I use gawk 3.1.4 for most of my day-to-day work, so that's why I got
>>the result that I got.
>
>It was a bug, now fixed.
I see. Interesting.
>And 3.1.4 is OOOOOOOOOOOLLLLLLLLLLLLLLLLDDDDDDDDDDDDDDDD. You should upgrade.
As I'm sure you're aware, I have my reasons for sticking with this version.
Specifically, I added some special^Wnon-standard functionality and I can't
really retro-fit my changes to every new released version. FWIW, it
probably wouldn't be *that* hard for me to retro-fit, but I haven't actually
looked at the latest source code, so I don't really know what would be
involved.
In any case, the need to "upgrade" hasn't been pressing enough for me to
bother (yet). Incidentally, I *do* want to take a look at the new
multi-dimensional arrays stuff - I want to see if it really works as well in
the latest GAWK as it does in TAWK.
>>Strange - because intuitively, you'd think that this operation was just a
>>passthrough to the underlying printf (in your standard C library), so the
>>version of GAWK shouldn't matter...
>
>What if you're on a system where the underlying printf doesn't support
>the apostrophe flag?
Interesting. I suppose there is a tradeoff, between consistency (a prime
design goal for GAWK is that it do the same thing on all platforms) vs.
optimal functionality. I say this because in my view, it isn't always 100%
clear which is best, and I remember that in the past there has been an
issue. Specifically, with the strftime() function. I remember that at some
point in the distant past, it wasn't clear whether GAWK would/should use the
system's strftime() or use its own supplied version. Sometimes one was
better, sometimes the other. I remember having to sometimes tweak the build
scripts to make it use one or the other, depending on which one *I* thought
was better in the instant circumstances.
>Gawk therefore does this itself, although as seen, for a while there
>was a bug.
I see.
>Gawk in fact only punts to the underlying printf for floating point
>values.
Interesting.
--
Faced with the choice between changing one's mind and proving that there is
no need to do so, almost everyone gets busy on the proof.
- John Kenneth Galbraith -