[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: status on $[arith] for eval arith vsl $((arith))??
From: |
Maarten Billemont |
Subject: |
Re: status on $[arith] for eval arith vsl $((arith))?? |
Date: |
Tue, 10 Apr 2012 09:33:34 +0200 |
On 09 Apr 2012, at 11:46, Linda Walsh wrote:
>
> 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)...
Just thought I'd add that I personally prefer $((...)) mostly because of
consistency with other syntax. $ is always an indicator of expansion, and
since we have (( ... )) to perform an arithmetic evaluation (on its own as a
statement or in a for etc.), I'm very happy that putting a $ in front of that
is all it takes to expand the result of it. Just like putting a dollar in
front of a subshell construct expands the output of it and putting a dollar in
front of a parameter name expands the contents of it.
If we were to move to $[ ... ], then to keep that consistency, we'd have to
change (( ... )) to [ ... ], and it so happens that this command is already
taken for a different type of test entirely. (Don't give me the spiel about
how [...] is already arithmetic evaluation inside array indices, that's a
different syntax entirely, and perfectly fine - unless you'd prefer to turn it
into arr[ (( ... )) ], which is rather overkill.)
smime.p7s
Description: S/MIME cryptographic signature
- status on $[arith] for eval arith vsl $((arith))??, Linda Walsh, 2012/04/07
- Re: status on $[arith] for eval arith vsl $((arith))??, Mike Frysinger, 2012/04/07
- Re: status on $[arith] for eval arith vsl $((arith))??, Chet Ramey, 2012/04/07
- Re: status on $[arith] for eval arith vsl $((arith))??, Maarten Billemont, 2012/04/08
- Re: status on $[arith] for eval arith vsl $((arith))??, Chet Ramey, 2012/04/08
- Re: status on $[arith] for eval arith vsl $((arith))??, dethrophes, 2012/04/08
- Re: status on $[arith] for eval arith vsl $((arith))??, Maarten Billemont, 2012/04/09
- Re: status on $[arith] for eval arith vsl $((arith))??, Linda Walsh, 2012/04/09
- Re: status on $[arith] for eval arith vsl $((arith))??,
Maarten Billemont <=
- Re: status on $[arith] for eval arith vsl $((arith))??, Chet Ramey, 2012/04/10
- Message not available
- Re: status on $[arith] for eval arith vsl $((arith))??, Aharon Robbins, 2012/04/09
- Re: status on $[arith] for eval arith vsl $((arith))??, Linda Walsh, 2012/04/09
- Re: status on $[arith] for eval arith vsl $((arith))??, Chet Ramey, 2012/04/09
- Re: status on $[arith] for eval arith vsl $((arith))??, Elliott Forney, 2012/04/10
- Re: status on $[arith] for eval arith vsl $((arith))??, Chet Ramey, 2012/04/10
- Re: status on $[arith] for eval arith vsl $((arith))??, Linda Walsh, 2012/04/11
- Re: status on $[arith] for eval arith vsl $((arith))??, Greg Wooledge, 2012/04/11
- Re: status on $[arith] for eval arith vsl $((arith))??, Linda Walsh, 2012/04/12
- Re: status on $[arith] for eval arith vsl $((arith))??, Andreas Schwab, 2012/04/12