[EMAIL PROTECTED] (Bob Proulx) writes:
> Andreas Schwab wrote:
>> Bob Proulx writes:
>> > Paul Eggert wrote:
>> >> So, under your interpretation, "expr 010" would print 8, but "expr 010
>> >> + 0" would print 10? That doesn't sound right to me.
>> >
>> > My question was why couldn't a conforming
Andreas Schwab wrote:
> Bob Proulx writes:
> > Paul Eggert wrote:
> >> So, under your interpretation, "expr 010" would print 8, but "expr 010
> >> + 0" would print 10? That doesn't sound right to me.
> >
> > My question was why couldn't a conforming implementation interpret 010
> > as octal and th
[EMAIL PROTECTED] (Bob Proulx) writes:
> Note that I am not trying to change the behavior of expr but only to
> understand what the standard allows for its behavior.
Ah, sorry, I thought you wanted us to extend "expr".
> How can clarifying the standard to more strongly say that arguments
> are i
[EMAIL PROTECTED] (Bob Proulx) writes:
> Paul Eggert wrote:
>> So, under your interpretation, "expr 010" would print 8, but "expr 010
>> + 0" would print 10? That doesn't sound right to me.
>
> My question was why couldn't a conforming implementation interpret 010
> as octal and therefore print a
Paul Eggert wrote:
> Bob Proulx writes:
> > integer
> > An argument consisting only of an (optional) unary minus followed by
> > digits.
>
> It also says, for example:
> expr1 + expr2 Addition of decimal integer-valued arguments.
Hmm... Yes, but it could also be read that only decimal
in
[EMAIL PROTECTED] (Bob Proulx) writes:
> integer
>
> An argument consisting only of an (optional) unary minus followed by
> digits.
It also says, for example:
expr1 + expr2 Addition of decimal integer-valued arguments.
So, under your interpretation, "expr 010" would print 8, but "expr 0
Paul Eggert wrote:
> Bob Proulx writes:
> > However, I can't see anywhere that expr is defined to always read
> > integers as decimal values.
>
> The current documentation says under "expr invocation"
>
> Operands are either integers or strings. Integers consist of one or
> more decimal digits,
[EMAIL PROTECTED] (Bob Proulx) writes:
> However, I can't see anywhere that expr is defined to always read
> integers as decimal values.
The current documentation says under "expr invocation"
Operands are either integers or strings. Integers consist of one or
more decimal digits, with an option
I recently suggested that expr could be used to convert values from
user input or other places to strict decimal form. And it can
validate non-numberic input easily. Example:
expr 08 + 0
8
expr foo + 0
expr: non-numeric argument
However, I can't see anywhere that expr is defined to alwa