Repository navigation
Changed and() and or() to stop at the argument that decides the result - #6440
Draft
nickanderson wants to merge 1 commit into
Draft
nickanderson wants to merge 1 commit into
nickanderson wants to merge 1 commit into
Conversation
nickanderson
marked this pull request as draft
October 26, 2026 13:09
and() and or() now have delayed evaluation and expand their arguments one at a time, from left to right. They return at the first false (and()) or true (or()) argument, so function calls in the remaining arguments are not made, like && and || in C or shell. A function that would fail after the deciding argument no longer causes the whole call to be skipped. Handling of unresolved variables doesn't change: if any argument (including nested function calls) has one, evaluation is skipped for now. Only variables are expanded for this check, no functions are called. none() and reglist() now also stop at the first matching element, like some() and regarray() already did. Their results don't change. Ticket: CFE-4272 Ticket: CFE-4751 Changelog: Title
nickanderson
force-pushed
the
CFE-4272/master
branch
from
October 26, 2026 13:58
9cd5869 to
1e48d8e
Compare
|
Thanks for submitting a PR! Maybe @craigcomstock can review this? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
and() and or() now have delayed evaluation and expand their arguments
one at a time, from left to right. They return at the first false
(and()) or true (or()) argument, so function calls in the remaining
arguments are not made, like && and || in C or shell. A function that
would fail after the deciding argument no longer causes the whole call
to be skipped.
Handling of unresolved variables doesn't change: if any argument
(including nested function calls) has one, evaluation is skipped for
now. Only variables are expanded for this check, no functions are
called.
none() and reglist() now also stop at the first matching element, like
some() and regarray() already did. Their results don't change.
Ticket: CFE-4272
Ticket: CFE-4751
Changelog: Title