Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #15455

Re: shouldn't it the comma operator has the lowerest precedence in the shell arithmetic expression?

From Chet Ramey <chet.ramey@case.edu>
Newsgroups gnu.bash.bug
Subject Re: shouldn't it the comma operator has the lowerest precedence in the shell arithmetic expression?
Date 2019-10-02 09:34 -0400
Message-ID <mailman.759.1570023258.2651.bug-bash@gnu.org> (permalink)
References <CAD0rTC4c80xV7VtUehFm1RYycGFFdO2Mun7C8qw_PP9QgZHVCg@mail.gmail.com> <3f1d2555-dd46-9c8f-924b-8d6196358053@case.edu>

Show all headers | View raw


On 10/1/19 8:35 PM, hk wrote:
> Configuration Information :
> Bash Version: 5.0
> Patch Level: 0
> Release Status: release
> 
> Description:
> the code snippet from expr.c starting from line 141:
> 
>> /* This should be the function corresponding to the operator with the
>>    highest precedence. */
>> #define EXP_HIGHEST expcomma
> 
> 
> Am I understanding it wrong or is it a typo?

The bash arithmetic parser does things in reverse order, in a way. So
the comma operator is the first thing you call, and it calls functions
that implement the other operators in ascending priority order. You
didn't misunderstand it.


-- 
``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/

Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread


Thread

Re: shouldn't it the comma operator has the lowerest precedence in the shell arithmetic expression? Chet Ramey <chet.ramey@case.edu> - 2019-10-02 09:34 -0400

csiph-web