bug-gawk
[Top][All Lists]
Advanced

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

Re: [4.1.4]: nested indirect function calls diagnosed as error.


From: arnold
Subject: Re: [4.1.4]: nested indirect function calls diagnosed as error.
Date: Sat, 26 Mar 2022 11:56:07 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Hello. Thanks for the report. It does indeed reproduce in
the current code. I will take a look at it and see if it's
easy to fix.

Thanks,

Arnold

Kaz Kylheku <kaz@kylheku.com> wrote:

> Hi!
>
> GNU Awk 4.1.4 in Ubuntu 18 diagnoses the indicated line in the following 
> snippet.
>
> Does this reproduce in current?
>
> function okay(f1, f2, arg)
> {
>     return @f1(arg)
> }
>
> function not_so_hot(f1, f2, arg)
> {
>     return @f1(arg, @f2(arg)) # line 8: error here
> }
>
> function workaround(f1, f2, arg,
>                      tmp)
> {
>    tmp = @f2(arg)
>    return @f1(arg, tmp)
> }
>
> The diagnostic is:
>
> gawk: gawkbug.awk:8: error: attempt to use non-function `f1' in function 
> call.
>
>
> Though such nesting isn't described in the manual, it more or less 
> reasonably
> follows from the composition of expressions, including regular, direct
> function calls.
>
> Cheers ...



reply via email to

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