[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Indirect function calls in namespaces
From: |
Joep van Delft |
Subject: |
Indirect function calls in namespaces |
Date: |
Thu, 2 Dec 2021 18:06:07 +0100 |
Hi,
Consider this program:
========
#!/usr/bin/env -S gawk -f
@namespace "n"
function f() { }
BEGIN {
fun = "f"
@fun()
}
========
It errors with:
gawk: ./namespace_indirect_fuction_call.awk:9: fatal: `f' is not a
function, so it
cannot be called indirectly
Any of the following fixes it:
- remove namespace
- change namespace to "awk"
- set 'fun = "n::f"'
I would expect that the program would succeed, as the function name ought
to be
found inside the namespace without explicitly specifying it.
Thanks,
Joep
- Indirect function calls in namespaces,
Joep van Delft <=