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

Re: Arithmetic expression and TRY_BLOCK_ERROR



2005/9/27, DervishD <zsh@xxxxxxxxxxxx>:
>     Hi all :)
>     I'll try to make it short ;) Why this:
>     ...
>     (( TRY_BLOCK_ERROR = 0 ))
>     ...
>     and not just this:
>     ...
>     TRY_BLOCK_ERROR=0
>     ...
>     ?????
>

The parentheses make it an integer variable.  Also, that particular
assignment sets $? to 1.  Maybe that's desired.  I don't know. 
Probably it's just that it's a fairly compact syntax for setting an
integer variable.

ofb:1% thok=0                                                       17:08 ofb:~
ofb:1% (( khot = 0 ))                                               17:08 ofb:~
ofb:1% integer xox=0                                            17:08 <1> ofb:~
ofb:1% let box=0                                                    17:08 ofb:~
ofb:1% typeset -p thok khot xox box                                 17:09 ofb:~
typeset thok=0
typeset -i khot=0
typeset -i xox=0
typeset -i box=0



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