Skip to content

expressions: teach short-circuit evaluation of && and || - #4

Open
0xGeorgii wants to merge 1 commit into
mainfrom
short-circuit-logical-operators
Open

expressions: teach short-circuit evaluation of && and ||#4
0xGeorgii wants to merge 1 commit into
mainfrom
short-circuit-logical-operators

Conversation

@0xGeorgii

Copy link
Copy Markdown
Contributor

Adds a Short-Circuit Evaluation section to the Comparison and Logical Operators chapter: the right operand of &&/|| is evaluated only when the left operand does not determine the result, with the divisor-guard and bounds-guard idioms as examples, and a pointer to the bitwise operators for unconditional evaluation.

Matches the compiler as of Inferara/inference#309 and the spec as of Inferara/inference-language-spec#30.

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.

1 participant