bug-gawk
[Top][All Lists]
Advanced

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

Re: Proposal: document that getline is a function, not command/statement


From: arnold
Subject: Re: Proposal: document that getline is a function, not command/statement
Date: Wed, 10 Jul 2024 01:19:26 -0600
User-agent: Heirloom mailx 12.5 7/5/10

Hi.

I am not opposed to changes such as you suggest. Would you
be willing to submit a patch to doc/gawk.texi?  I am short of
cycles at the moment, and your help would be appreciated.
Since you work at Redhat, you would not need to sign paperwork
for your changes, which makes things even easier.

Thanks,

Arnold

Denys Vlasenko <dvlasenk@redhat.com> wrote:

> I *only now* realized that getline is a _function_
> and can be part of an expression.
>
> https://www.gnu.org/software/gawk/manual/gawk.html
>
> "getline command" string occurs 21 times.
> "getline statement" occurs 2 times.
> All examples of its use show it standalone,
> not as part of a larger expression, or part of e.g.
> a while() statement.
>
> (
> I only found people discussing examples of its use
> as function in other places, not gawk docs, such as here
> https://stackoverflow.com/questions/23596643/what-does-getline-0-in-awk-mean
> where "read until EOF/error" idiom is shown:
>          while (getline <"FILE" > 0) ...
> )
>
> Words "getline function" do occur in gawk.html - just two times.
>
> In manpage, "getline" is under "I/O Statements" together with
> real statements, e.g. "print", "next".
>
> Later on manpage, it is called "getline command", not "function".
>
> I propose to change all "getline command"s and "getline statement"s
> in docs with "getline function".
>
> Maybe add an example, I like the "while (getline <"FILE" > 0) ..."
> thing from stackoverflow.
>
> Thank you.
>



reply via email to

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