bug-gawk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [bug-gawk] typeof() array subscripts


From: Hermann Peifer
Subject: Re: [bug-gawk] typeof() array subscripts
Date: Sun, 21 Jun 2015 13:52:46 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

On 2015-06-20 20:57, Andrew J. Schorr wrote:
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?


No actual problem here, I was just too naïve, as it looks like.

Do I also see it right that typeof()'s "untyped" actually means "untyped scalar" whereas the debugger's "untyped variable" is a different animal, as it can turn into an array?

Hermann






reply via email to

[Prev in Thread] Current Thread [Next in Thread]