Skip to content

docs: Improve ground value and assignment docs#8047

Merged
charlieegan3 merged 1 commit intoopen-policy-agent:mainfrom
charlieegan3:ground-assign-equal
Nov 12, 2025
Merged

docs: Improve ground value and assignment docs#8047
charlieegan3 merged 1 commit intoopen-policy-agent:mainfrom
charlieegan3:ground-assign-equal

Conversation

@charlieegan3
Copy link
Copy Markdown
Contributor

@charlieegan3 charlieegan3 commented Nov 12, 2025

Fixes #6025

@netlify
Copy link
Copy Markdown

netlify bot commented Nov 12, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit 9e19ab0
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/6914913e746ffc0008772f93
😎 Deploy Preview https://deploy-preview-8047--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify bot commented Nov 12, 2025

Deploy Preview for openpolicyagent ready!

Name Link
🔨 Latest commit d0704eb
🔍 Latest deploy log https://app.netlify.com/projects/openpolicyagent/deploys/6914a56273b8b5000830a1c2
😎 Deploy Preview https://deploy-preview-8047--openpolicyagent.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown
Contributor

@johanfylling johanfylling left a comment

Choose a reason for hiding this comment

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

Thanks! 👍

### Assignment (`:=`)

The assignment operator (`:=`) is used to assign values to variables. Variables assigned inside a rule are locally scoped to that rule and shadow global variables.
The assignment operator `:=` is used to assign values to variables. Variables assigned inside a rule are locally scoped to that rule and shadow global variables.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Should we add something about preferring this operator over unification where applicable?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We could say something about Regal being helpful here, possibly with a pointer to relevant rules :)

Copy link
Copy Markdown
Contributor Author

@charlieegan3 charlieegan3 Nov 12, 2025

Choose a reason for hiding this comment

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

There is small section just further down in the doc with both points.

I personally felt it was fine to put this note etc with the = operator since if they only read about := we're fine and that's ok for new users anyway.

Fixes open-policy-agent#6025

Signed-off-by: Charlie Egan <charlie_egan@apple.com>
@charlieegan3 charlieegan3 enabled auto-merge (squash) November 12, 2025 15:18
@charlieegan3 charlieegan3 merged commit ff80b82 into open-policy-agent:main Nov 12, 2025
20 checks passed
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.

Please document the term "ground value"

3 participants