-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
cast_xyz functions in language reference are confusing #1405
Comments
tsandall
added a commit
to tsandall/opa
that referenced
this issue
Jun 27, 2019
Fixes open-policy-agent#1405 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
tsandall
added a commit
that referenced
this issue
Jun 27, 2019
Fixes #1405 Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Hey @tsandall, I'm currently using the cast_set function to cast an array to a set so I can perform functions like intersection. Can you tell me what the alternative is now that cast_set is deprecated? |
@GBrawl you can you write a simple comprehension that converts the array into a set: a_set := {x | x := arr[_]} |
That works well, thanks! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Users frequently think they should use the cast_xyz functions to convert from one type to another however the cast functions have somewhat inconsistent behaviour:
cast_number
is not defined.I don't think these functions are worth the confusion they introduce. We should remove them from the docs and deprecate them.
The text was updated successfully, but these errors were encountered: