Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README: clarify that arithmetic expansions perform nested expansions lazily #326

Open
rob-myers opened this issue Nov 27, 2018 · 1 comment

Comments

@rob-myers
Copy link

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.

@mvdan
Copy link
Owner

mvdan commented Nov 28, 2018

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 mvdan changed the title gosh: ternary operator in arithmetic expressions. README: clarify that arithmetic expansions perform nested expansions lazily Nov 29, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants