Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
syntactic triviality
- X-seq: zsh-users 19625
- From: Ray Andrews <rayandrews@xxxxxxxxxxx>
- To: Zsh Users <zsh-users@xxxxxxx>
- Subject: syntactic triviality
- Date: Sun, 21 Dec 2014 10:33:18 -0800
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
This is completely unimportant, but if anyone is interested:
while true && true; do echo true; done
I'm wondering if, strictly speaking, the 'do' needs to be necessary.
I'm guessing that it's necessary by fiat simply because it visually
pairs nicely with 'done', which certainly must be there to end a block
of commands. I'm thinking that the semi after 'true' ends the condition
tests part of the loop, and begins the execution part, thusly, after the
semi, the 'do' tells the parser nothing that it does not already know,
thusly it might have been possible to design the syntax without the
'do'. (Not that I'm suggesting that, I'm just curious.) IOW, is there
some situation where the parser might actually be confused after the
first semi, and before the 'do', such that the 'do' adds necessary control?
Same thing with the 'then' in 'if' tests.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author