Skip to content

Conversation

@DFrenkel
Copy link
Contributor

Also: implementing internal.member_3 for compliance testing

Resolves #12

Also: implementing internal.member_3 for compliance testing

Resolves open-policy-agent#12

Signed-off-by: Dmitry Frenkel <[email protected]>
Copy link
Contributor

@srenatus srenatus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still new to Swift, but it looks OK. Nicely done with the reduce. And you're extending the test assertions to cover the "want" part, too, when types don't match. 👍

One question inline. 👇

return try doPlus(args: args)
}

static func doPlus(args: [AST.RegoValue]) throws -> AST.RegoValue {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[swift newbie] Why do we do this? The only difference I spot besides the arguments is that plus is async, doPlus is not.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Exactly - we wanted a (shared) synchronous implementation that could be used in synchronous contexts, but you still need the async signature for the builtin entrypoint because we're plumbed for future async builtins that do I/O.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@srenatus srenatus merged commit 336407b into open-policy-agent:main Oct 31, 2025
3 checks passed
@DFrenkel DFrenkel deleted the aggregates2 branch November 6, 2025 18:48
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.

builtins: implement aggregates sum, product and sort

3 participants