On Mon, 11 Dec 2023 at 06:55, Chet Ramey <chet.ra...@case.edu> wrote:
> It came up as a bug report in > > https://lists.gnu.org/archive/html/bug-bash/2019-06/mstheng00042.html > <https://lists.gnu.org/archive/html/bug-bash/2019-06/msg00042.html> > > (part of the followup discussion after the second linked thread above) > and the consensus among those who participated was that it was a good > thing to prevent base# without any digits from silently being treated > as 0. The wrap-up at the end of that discussion was this: > *I'm not sure how relevant that language is to integer constants in > expressions. I could also note that the language describing the base#n > syntax only talks about digits, letters, `@', and `_'. The bash definition > of arithmetic evaluation is taken from C. That includes integer constants, > and, while the base#value syntax clearly extends the C definition of a > constant, the `-' (and `+', FWIW) is still an operator as defined by C.* One could be forgiven for taking that to mean "this is behaving as expected and won't be changed". Do you think there would have been more discussion in different > circumstances? That entire discussion was between 4 people, and started and finished in less than a week. Anyone who happened not to be around would have missed it, including me. Can a consensus among 4 people really be fair and representative of millions of Bash users? Would you have participated, considering there's no sign of you on the > bug-bash list between 2016 and 2020? > When the instructions say "send bug reports to X-bugs", it's natural to assume that the primary audience for X-bugs is the people who fix bugs, and other people should stay away. So for a long time I didn't join this list because I wasn't in a position to contribute as a fixer. Of course, that's not the only reason why people don't participate: sometimes real life gets in the way and we don't have time to participate, sometimes for weeks on end. But yes, I would have participated had I known this discussion was going on. In most projects this lack of discussion wouldn't matter: after the discussion comes a proposed code change, and then code review, and then even after release, it's an "experimental feature that may be retracted". When we don't have those extra steps, and every release of bash is "forever", yes, we need more considered discussion up front. -Martin PS: When I said "change the definition of a token", I meant specifically changing the definition of the integer constant token, to require at least one "digit" after the '#'.