Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Late Function Bindings in Go Cel Evaluation #356

Open
mswest46 opened this issue May 19, 2020 · 1 comment
Open

Late Function Bindings in Go Cel Evaluation #356

mswest46 opened this issue May 19, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@mswest46
Copy link

Currently, function definitions must be provided in the parsing step, so data relevant to their definition must be available at that step. This request is to support binding a function at activation time instead. As a use case example, I'd like to write a function has_tag :: string -> bool whose implementation checks membership in a list tags that is only available at evaluation time and remains hidden from the expression writer.

@JimLarson
Copy link
Contributor

We're discussing a generalization of this - allow functions to access the full Activation, not just the supplied variables. This way you could bind tags as a variable at runtime in the normal way, but it would be hidden from the expression if you omit it from the declarations at type check time. This would require a separate flavor of overload which would accept something like func(interpreter.Activation, ...ref.Val) ref.Val.

@TristonianJones TristonianJones added this to the CEL Go v0.6.0 milestone May 28, 2020
@TristonianJones TristonianJones added the enhancement New feature or request label May 28, 2020
@TristonianJones TristonianJones removed this from the CEL v0.8.0 milestone Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants