[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug with PROCINFO["identifiers"]
From: |
anoncoward |
Subject: |
Bug with PROCINFO["identifiers"] |
Date: |
Wed, 02 Sep 2020 17:09:34 -0700 |
If one has a user defined variable (scalar or array),
PROCINFO["identifiers"] always returns ``untyped''
even if the type is known.
(Hushmail will wrap the lines. My apologies.)
$ LC_ALL=C ./gawk 'BEGIN {s="a"; i=1; ar[1]=3; print
PROCINFO["identifiers"]["s"], PROCINFO["identifiers"]["i"],
PROCINFO["identifiers"]["ar"] }'
untyped untyped untyped
but the program obviously knows that s and i are scalars and ar is
an array. For example,
$ LC_ALL=C ./gawk 'BEGIN {s="a"; i=1; ar[1]=3; print typeof(s),
typeof(i), typeof(ar) }'
string number array
Per your request, I compiled the latest version of gawk and tested
it.
./gawk -V
GNU Awk 5.1.0, API: 3.0
Copyright (C) 1989, 1991-2020 Free Software Foundation.
This program is free software; you can redistribute it and/or
modify
it under the terms of the GNU General Public License as published
by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see http://www.gnu.org/licenses/.
Thanks
- Bug with PROCINFO["identifiers"],
anoncoward <=