sh icon indicating copy to clipboard operation
sh copied to clipboard

README: clarify that arithmetic expansions perform nested expansions lazily

Open rob-myers opened this issue 7 years ago • 1 comments

Your parser permits lazy evaluation of the ternary operator - ? - : -, and gosh does so:

~$ gosh
$ (( 1 + 1 == 2 ? 1 : $( echo foo >&2; echo 1) )) 
$  # bash would output foo here

This is great, but perhaps it should be optional or noted somewhere?

Source: http://mywiki.wooledge.org/BashFAQ/031#Theory.

rob-myers avatar Nov 27 '18 19:11 rob-myers

This is a good point. I think we could cover this together with the confusion about a='b + c'; (($a)) not working like in Bash.

mvdan avatar Nov 28 '18 18:11 mvdan