bug-gawk
[Top][All Lists]
Advanced

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

Workaround for Inconsistency in Namespace Internal Name Management


From: J Naman
Subject: Workaround for Inconsistency in Namespace Internal Name Management
Date: Fri, 31 Dec 2021 12:55:50 -0500

I do not know if bug-gawk@gnu.org is the appropriate venue for reporting
workarounds to problems/issues/bugs. I will do it this time and until
someone informs me of the proper process.
My solution/workaround to the current Namespace Internal Name Management
Inconsistency focuses on the intersection of indirect function calls and
the newer Gawk Namespace feature:

function have(lst,key,fun) { *# update to Github aok/codingtips.aok by
tim@menzies.us <tim@menzies.us>*
    *sub(/^awk::/,"",fun);    *# change+ added because there is currently
not 'awk::'s in FUNCTAB
    #change- *if (fun)*           # tests if optional third argument
constructor function
    *if (fun in FUNCTAB)    *# change+ test if fun is actually in FUNCTAB
to *avoid fatal error*
#change+ #avoids: fatal: `foo' is not a function, so it cannot be called
indirectly
      @fun(lst[key])
} # no more fatalities

'Best, John Naman, gawker@703n.com


reply via email to

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