Skip to content

Conversation

@cgettys-microsoft
Copy link
Contributor

Program, at least today, appears to purely be a thin convenience wrapper around IdedExpr (Expression) - everything it can do, you can do yourself.

I have a use case that benefits from inspecting the AST (in short, memoizing that certain expressions can never evaluate certain ways - think basically partial evaluation, given these particular values, but with everything else unknown).
Now, obviously I can do without this; it just requires basically including my own version of Program in my program.
But given that everything Program exposes is already public - and therefore, anything that changes this particular field would be a semver change anyway - I don't see a great reason not to allow getting a const reference to the contained Expression. If this later changes, that's ok, it'll be no more breaking that if folks used Expression directly.

@clarkmcc clarkmcc merged commit 569546c into cel-rust:master Jul 30, 2025
3 checks passed
@cgettys-microsoft cgettys-microsoft deleted the expose_expression branch July 30, 2025 20:22
@clarkmcc clarkmcc added this to the 0.11.0 milestone Aug 1, 2025
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.

2 participants