Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Arithmetic expression and TRY_BLOCK_ERROR



    Hi Bart :)

 * Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> dixit:
> On Sep 28, 10:46am, DervishD wrote:
> }
> }     'let variable=0' is shorter ;) I really don't know the reason,
> } but I can find this kind of assignment everywhere :-/
> I suspect it's simply Peter's preference to always use variables in
> a consistent context, i.e., either in math expressions or out, not
> some of each.  A possible reason for this is future-proofing.

    I understand, thanks for the explanation :)

> Also, some people prefer the readability of being able to put spaces
> around the "=".

    Me, for example. In fact, the entire ((...)) syntax is quite good
when reading shource files, it really catches the eye.
 
> However, doing integer/float assignments in math context is marginally
> more efficient than doing them as plain assignments.  In a single
> command this is probably offset by the overhead of parsing the (( )),
> but in a loop it could become important, and if you're in the habit of
> always writing the (( )) you won't forget them where they matter.

    Thanks for both the explanation and the advice :)

    Raúl Núñez de Arenas Coronado

-- 
Linux Registered User 88736 | http://www.dervishd.net
http://www.pleyades.net & http://www.gotesdelluna.net
It's my PC and I'll cry if I want to...



Messages sorted by: Reverse Date, Date, Thread, Author