Op 29-12-19 om 23:55 schreef Thorsten Glaser:
As discussed heavily on IRC, other shells can use ((…)) or let to work
like mksh, and the mksh behaviour is semantically correct.
Your position makes no sense, because in mksh (and ksh93, bash, zsh) you
can do things like:
$ typeset -i i
$ i=4+4; echo $i
8
$ i=i+1; echo $i
9
...yet, in mksh:
$ i+=1; echo $i
91
That is clearly inconsistent. 'typeset -i' makes shell assignments
interpret arithmetic expressions (as is documented in the manual page),
and '+=' is just another form of shell assignment, therefore it should
be changing the behaviour of '+=' as well as '='.
ksh93, bash and zsh all act correctly here. mksh is a ksh clone and
should be acting like ksh and all the others that have emulated ksh.
- M.
--
modernish -- harness the shell
https://github.com/modernish/modernish