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: Aharon Robbins
Subject: Re: [bug-gawk] Another typeof() issue
Date: Mon, 29 Jun 2015 20:01:11 +0300
User-agent: Heirloom mailx 12.5 6/20/10

Hi.

The debugger runs as part of gawk itself, unlike most other debuggers
where the debugger is one process and the debuggee is another.

This is an artifact of the implementation. I traced down what's causing
it, and I might could even fix it, but I think I'll just document it instead.

Thanks,

Arnold

> Thanks for taking care. When looking at fields, the results of typeof() 
> are somewhat different to my expectations, but maybe these are wrong (?).
>
> Hermann
>
> $ echo "abc 123" > data
> $ echo '{print typeof($1), typeof($2)}' > test.awk
>
> # Expected types: string strnum
> $ awk -f test.awk data
> strnum strnum
>
> # Debugging returns the opposite of the expected results
> $ printf 'w $1 \n w $2 \n r \n n \n n' | awk -D -f test.awk data
> Watchpoint 1: $1
> Watchpoint 2: $2
> Starting program:
> Stopping in Rule ...
> Watchpoint 1: $1
>    Old value: ""
>    New value: "abc"
> main() at `test.awk':1
> 1       {print typeof($1), typeof($2)}
> Watchpoint 2: $2
>    Old value: ""
>    New value: "123"
> main() at `test.awk':1
> 1       {print typeof($1), typeof($2)}
> strnum string  # ???



reply via email to

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