Re: Arithmetic expression: evaluation order bug

2022-12-30 Thread Robert Elz
Date:Fri, 30 Dec 2022 16:48:15 +0100 From:Steffen Nurpmeso Message-ID: <20221230154815.7-tqs%stef...@sdaoden.eu> | Of course i continue to disagree as i continue to | disagree on much of the sequence point outcome of ISO C, too. There's a big difference between

Re: Arithmetic expression: evaluation order bug

2022-12-30 Thread Steffen Nurpmeso
Robert Elz wrote in <10111.1672392...@jacaranda.noi.kre.to>: ... |The way to make this work is to insert sequence points, of which there |is only one which is plausible in shell arithmetic expressions, and even |that isn't required to exist by POSIX. | | $(( i += i, j += i, i += j )) | |

Re: Arithmetic expression: evaluation order bug

2022-12-30 Thread Steffen Nurpmeso
Greg Wooledge wrote in : |On Fri, Dec 30, 2022 at 12:21:52AM +0100, Steffen Nurpmeso wrote: |> ..i want to reiterate the relation to what "human logic" expects. | |I'm a human, so I feel qualified to address this point. | |What I expect from a command like | |(( i += j += i += j )) | |is

Re: Arithmetic expression: evaluation order bug

2022-12-30 Thread Robert Elz
Date:Thu, 29 Dec 2022 21:57:00 + From:Alain D D Williams Message-ID: <20221229215700.gd16...@phcomp.co.uk> | So use sub-expressions to 'evaluate first' so you should prolly rewrite: | | (( i += j += i += i )) | | as: | | (( i += (j += (i += i)) ))