bug-gawk
[Top][All Lists]
Advanced

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

Re: [bug-gawk] Another typeof() issue


From: Hermann Peifer
Subject: Re: [bug-gawk] Another typeof() issue
Date: Mon, 29 Jun 2015 07:46:20 +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-29 7:07, address@hidden wrote:
Hi.

Interesting test cases.  "strnum" should probably be renamed
"userdata"; it means that the data came from the user and if it
looks numeric should be treated as such in a comparison.

For me, "strnum" makes sense, as name for "the concept of a numeric string, which is simply a string that looks like a number". This is well explained in the manual: 6.3.2.1 String Type versus Numeric Type

The output from the debugger is also interesting. Gawk occasionally
behaves differently under the debugger even though it shouldn't. I'll
take a look.

Once you are looking at the debugger, here 2 surprising error messages:

$ echo 'BEGIN{a; b[1]}' > test.awk

$ awk -D -f test.awk
gawk> eval "typeof(a)"
awk: cmd. line:1: error: attempt to use non-function `typeof' in function call
gawk> eval "isarray(b)"
awk: cmd. line:1: error: function name address@hidden' previously defined

I'm starting to wonder if I shouldn't revert these new features.


IMO, replacing isarray() with typeof() was a good idea.

Hermann



reply via email to

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