forked from open-policy-agent/opa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Previously, if callers omitted output terms from call expressions, the result would be ignored. This was fine for most calls which would only return true if they were defined, however, for functions could return false this became confusing because an expression like "f(1)" where f(1) = false would be succeed and yield a result. With these changes, built-in functions that used to only return true always return true or false and the eval engine takes care to check if the result is false when the the caller omits the output term. This provides consistent behaviour across cases like... f(1) => undefined (previously {}) f(1,x) => {x:false} (previously {x:false}) neq(1,1,x) => {x:false} (previously undefined) neq(1,1,false) => {} (previously undefined) neq(1,1,true) => undefined (previously undefined) In the next set of changes, the Rego package will be updated to capture values for expressions like the first one above so that function calls behave like refs (i.e., their values are returned).
- Loading branch information
Showing
10 changed files
with
76 additions
and
112 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.