help-bash
[Top][All Lists]
Advanced

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

Re: Why yacc_EOF is used as a list_terminator for for_command?


From: Peng Yu
Subject: Re: Why yacc_EOF is used as a list_terminator for for_command?
Date: Wed, 12 May 2021 09:00:09 -0500

On Wed, May 12, 2021 at 7:18 AM Koichi Murase <myoga.murase@gmail.com> wrote:
>
> 2021年5月12日(水) 21:11 Alex fxmbsw7 Ratchev <fxmbsw7@gmail.com>:
> > oh i see
> > so whats the conclusion
>
> I'm not sure if it is already concluded. Peng pointed out that it's
> unnecessary in the syntax rule, which I agree with. Peng claims it's
> ``incorrect'', which I don't agree with. I think it's just a kind of
> ``overloading'' of the concept ``list_terminator'' for convenience,
> which is reused in the definition of `for' statement. I'm not sure
> what Peng would say about this way of thinking in the next reply if
> any.

I am not referring to anything in whether the current bash should be
changed or not. After all, that is Chet's call. If he had
intentionally (there is also a chance that he didn't notice it, but
only he can answer which case it is) decided to include yacc_EOF in
the for-statement and bash has worked with it for so long without a
problem, I'd expect that it should continue to work properly in
practice. There is no point to change the bash source code at this
point of time as changing the code can only introduce chances to break
other source code of bash.

What I refer to is, if I were to rewrite bash from scratch, whether
yacc_EOF should be included or not. I would not include it as it has
been shown to be unnecessary. You can consider it as overloading. It
is more like a personal preference. I tend to write code on the
conservative side. That is, if a piece of code is not indended, I
would not include it. I'd make sure the code precisely has the meaning
of what I want it to mean. It may turn out that it does not matter in
practice. But that is my preference.

-- 
Regards,
Peng



reply via email to

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