On Sat, Jun 20, 2015 at 01:23:22PM +0200, Hermann Peifer wrote:
I just came across the new builtin function typeof() in gawk master and made
the below observations which I found confusing, because "array subscripts
are always strings", as I learned from the manual. Maybe I am overlooking
something.
Well, the truth is not quite as simple as the manual makes it out to be.
The code has some different backend array implementations to optimize
performance for arrays with integer subscripts, since that's an important
usage case.
I think what you're seeing here are artifacts of that issue. For fun, try the
same tests with "gawk -M". I don't think it should really matter; can you
think of cases where this could cause trouble?