|
From: | Linda Walsh |
Subject: | Re: status on $[arith] for eval arith vsl $((arith))?? |
Date: | Mon, 09 Apr 2012 02:46:43 -0700 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.24) Gecko/20100228 Lightning/0.9 Thunderbird/2.0.0.24 Mnenhy/0.7.6.666 |
Maarten Billemont wrote:
On 08 Apr 2012, at 21:30, Chet Ramey wrote:On 4/8/12 3:02 PM, Maarten Billemont wrote:Any particular reason for not removing old undocumented functionality, or is that mostly the nature of this beast - dragging along and maintaining ancient code for the sake of compatibility?=Because, as Linda discovered, there is still working code out there using it. Maybe we'll get to a point where it's all gone, but we're not there yet.IMO, the working code out there that relies on $[...] either runs on older versions of bash.
Actually it was a version of 'sh', Seems like it it's also in 'zsh'. I note. or if the sysadmin decided to upgrade bash, he can assume the responsibility to fix the code.Might be a good reason to ditch bash and stick with something that supports a syntax that's been around for 20 years.
Like it costs how much? I would **bet** that it cost more code to support (()) than to support [] as arith ops .. so if you want my opinion, lets toss (())...
(like that'll happen)...[] is 1 token -- (()) is a double token. (()) is much less legible because it is used IN the expressions [] isn't a grouping operator in an arith expression.
Also if you start with $((, that doesn't mean what follows is a arith expression...as in
$(((1)) && echo ok) -- only arith expression is after the 3rd paren.$(()) for arith expressions is ugly!.... -- since the $ on the outside of (()) changes it meaning visually it is more ambiguous... Why $[] wasn't used makes
no sense -- unless someone did it the other way just to make political waves...as seems to often be the outlet of frustrated and unimportant people -- if they can make others lives more miserable, then they have created their own importance.
*plegh*...
[Prev in Thread] | Current Thread | [Next in Thread] |