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: Chet Ramey
Subject: Re: Why yacc_EOF is used as a list_terminator for for_command?
Date: Wed, 12 May 2021 10:49:30 -0400
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.10.1

On 5/12/21 10:00 AM, Peng Yu wrote:
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.

If anyone's curious, the list_terminator production including yacc_EOF
dates from at least 1989.

(Again, if anyone has bash versions before bash-1.02, I would be very
interested in getting copies. We didn't pay as much attention to software
preservation in those days as we should have.)

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.

There are a lot of hypotheticals here.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    chet@case.edu    http://tiswww.cwru.edu/~chet/



reply via email to

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