Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15458
| From | "hkadeveloper"<hkadeveloper@gmail.com> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: shouldn't it the comma operator has the lowerest precedence intheshell arithmetic expression? |
| Date | 2019-10-02 22:50 +0800 |
| Message-ID | <mailman.767.1570027821.2651.bug-bash@gnu.org> (permalink) |
| References | <tencent_D677133F9DB7D6B3D6115ADB@qq.com> |
Yes. I understand what you are saying. I mean isn’t it a little
inconsistent about the comment, the macro name(EXP_HIGHEST) and the
macro value(expcomma)?
Thanks for you reply!
------------------ Original ------------------
From: "Chet Ramey" <chet.ramey@case.edu>; <"Chet Ramey"
<chet.ramey@case.edu>;>
Date: Wed,Oct 2,2019 10:28 PM
To: hkadeveloper <hkadeveloper@gmail.com>
Subject: Re: shouldn't it the comma operator has the lowerest
precedence inthe shell arithmetic expression?
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
Re: shouldn't it the comma operator has the lowerest precedence intheshell arithmetic expression? "hkadeveloper"<hkadeveloper@gmail.com> - 2019-10-02 22:50 +0800
csiph-web