Skip to content

Document short-circuit evaluation of and/or on the Boolean page - #2265

Merged
fdncred merged 1 commit into
nushell:mainfrom
qodelicious:docs-bool-short-circuit
Oct 18, 2026
Merged

fdncred merged 1 commit into
nushell:mainfrom
qodelicious:docs-bool-short-circuit

Conversation

@qodelicious

Copy link
Copy Markdown
Contributor

Fixes #2072

The Language Reference Guide's operators page already says and and or short-circuit, but the Boolean type page doesn't mention it, which is where the issue went looking. This adds a short "Short-circuit evaluation" section to bool.md explaining when the right-hand side is skipped, with an example using a command that prints when it is called, and one showing a guard (($text != "") and (...)).

I ran the examples with nu 0.116.2 and the output matches what the page shows. prettier --check passes on the file.

@fdncred
fdncred merged commit a1fe874 into nushell:main Oct 18, 2026
2 checks passed
@fdncred

fdncred commented Oct 18, 2026

Copy link
Copy Markdown
Contributor

Thanks

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

Successfully merging this pull request may close these issues.

Are Boolean operators lazy?

2 participants