Skip to content

v0.7.6

Choose a tag to compare

@ryuichiueda ryuichiueda released this 15 Sep 04:52
· 2421 commits to main since this release

Implemented short-circuit evaluation in arithmetic operation

As Bash does, this version does not evaluate the rightside of && or || when the result is fixed.

🍣 B=0 ; echo $(( 0 || (B=2) )) ; echo $B
1 
2          # B=2 is evaluated 
🍣 B=0 ; echo $(( 1 || (B=2) )) ; echo $B
1
0          # B=2 is not evaluated. 
🍣 B=0 ; echo $(( 0 && (B=2) )) ; echo $B
0
0
🍣 B=0 ; echo $(( 1 && (B=2) )) ; echo $B
1
2