Groups | Search | Server Info | Login | Register
Groups > comp.lang.awk > #10014
| From | gazelle@shell.xmission.com (Kenny McCormack) |
|---|---|
| Newsgroups | comp.lang.awk |
| Subject | Re: GAWK mystery parses |
| Date | 2025-10-03 07:06 +0000 |
| Organization | The official candy of the new Millennium |
| Message-ID | <10bnskv$cefk$1@news.xmission.com> (permalink) |
| References | <10bnjs1$br9v$1@news.xmission.com> <20251002231443.863@kylheku.com> |
In article <20251002231443.863@kylheku.com>,
Kaz Kylheku <643-408-1753@kylheku.com> wrote:
>On 2025-10-03, Kenny McCormack <gazelle@shell.xmission.com> wrote:
>> The topic for today is: What can we get away with for clause 3 of a "for"
>> statement.
>>
>> Observe (notice that the print statement is *inside* the for statement):
>>
>> First, we use a print statement as clause 3:
>> % gawk4 'BEGIN { for (i=1; i<=5; print "i =",i++); }'
>> i = 1
>> i = 2
>> i = 3
>> i = 4
>> i = 5
>
>That's interesting, and useless; yet, stupidly, you cannot have comma
>expressions like for (i = 0, j = 0; ...
TAWK allows that syntax, but only in the "for" statement. It doesn't allow
it as a general expression (outside of "for"), like C does.
>What you found is not portable:
I'm not surprised. I was just amazed it works at all.
--
Which of these is the crazier bit of right wing lunacy?
1) We've just had another mass shooting; now is not the time to be talking about gun control.
2) We've just had a massive hurricane; now is not the time to be talking about climate change.
Back to comp.lang.awk | Previous | Next — Previous in thread | Find similar
GAWK mystery parses gazelle@shell.xmission.com (Kenny McCormack) - 2025-10-03 04:36 +0000
Re: GAWK mystery parses Kaz Kylheku <643-408-1753@kylheku.com> - 2025-10-03 06:20 +0000
Re: GAWK mystery parses gazelle@shell.xmission.com (Kenny McCormack) - 2025-10-03 07:06 +0000
csiph-web