[BusyBox] modified libbb/arith.c -- size reduction (30%) and bug fix

Aaron Lehmann aaronl at vitelus.com
Sat Aug 25 23:16:33 UTC 2001


On Sun, Aug 26, 2001 at 01:20:20AM -0400, Tom Cameron wrote:
> Aaron,
> 	I, for one, do _not_ like the idea of programing around user errors.
> After working in the computer industry for 12 years, the one thing that
> I have found is that you should (in a polite way) make people aware of
> their errors. Even if it makes the final product smaller, I don't like
> the idea of the shell not telling me that I have made a mistake.

Erm, I don't think we're talking about quite the same thing. I was
intending to suggest this modification so users didn't *have* to match
their parentheses, and the program didn't *have* to check. Forcing the
user to complete parentheses is like stronly-typing a language: it's a
double-edged sword. I wasn't thinking of it as excusing errors, but
rather making the interpreter less strict. Forcing matching parens can
catch errors, or can be a PITA.

Of course, this can deviate from the POSIX standard, which I hope to
avoid. But I don't think that POSIX mandates certain behavior in
handling uncompliant input. So, while a user should never use the
extension I'm proposing, it could be convinient because 1) a user
typing at the shell doesn't have to completely comply with the strict
POSIX standard for arith, the shell will let them off sometimes  2) it
is simpler and more understandable for the internal design of the
arith parser to just let mismatched parens slide. What do you think? I
understand where you're coming from.





More information about the busybox mailing list