Skip to content

implement .isEmpty() method#1358

Merged
cdisselkoen merged 8 commits intomainfrom
cdisselkoen/isEmpty
Dec 6, 2024
Merged

implement .isEmpty() method#1358
cdisselkoen merged 8 commits intomainfrom
cdisselkoen/isEmpty

Conversation

@cdisselkoen
Copy link
Contributor

Description of changes

New builtin .isEmpty() method, which works on Sets. Implemented similarly to .contains() which works on Sets. This is our first builtin method that takes 0 arguments other than its receiver (although we have extension methods that take 0 arguments other than their receiver).

This PR contains the changes necessary in this repo (unless I've missed something); we'll also need changes in DRT, the Lean model, and the public docs.

Issue #, if available

Fixes #1356

Checklist for requesting a review

The change in this PR is (choose one, and delete the other options):

  • A backwards-compatible change requiring a minor version bump to cedar-policy (e.g., addition of a new API).

I confirm that this PR (choose one, and delete the other options):

  • Updates the "Unreleased" section of the CHANGELOG with a description of my change (required for major/minor version bumps).

I confirm that cedar-spec (choose one, and delete the other options):

  • Requires updates, and I have made / will make these updates myself. (Please include in your description a timeline or link to the relevant PR in cedar-spec, and how you have tested that your updates are correct.)

I confirm that docs.cedarpolicy.com (choose one, and delete the other options):

  • Requires updates, and I have made / will make these updates myself. (Please include in your description a timeline or link to the relevant PR in cedar-docs. PRs should be targeted at a staging-X.Y branch, not main.)

Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
@cdisselkoen cdisselkoen merged commit 7c0e05b into main Dec 6, 2024
@cdisselkoen cdisselkoen deleted the cdisselkoen/isEmpty branch December 6, 2024 19:28
benelser pushed a commit to benelser/cedar that referenced this pull request Jan 16, 2026
Signed-off-by: Craig Disselkoen <cdiss@amazon.com>
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.

Request for isEmpty() Set operator

3 participants