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

.type() function #134

Open
divarvel opened this issue Apr 25, 2023 · 0 comments
Open

.type() function #134

divarvel opened this issue Apr 25, 2023 · 0 comments
Milestone

Comments

@divarvel
Copy link
Collaborator

Ill-typed operations currently make evaluation fail. This makes it easy to have datalog evaluation errors, since introducing a new fact with terms of an unexpected types can make a rule blow up somewhere else.

If we go ahead with lazy || and &&, introducing a typeof operator would allow guarding operations with a type check, providing a way to avoid evaluation failure in the face of terms of unexpected types.

For instance:

`check if resource($resource), $resource.type() == "string" && resource.starts_with("file_")`

using a .type() method call would integrate cleanly with the existing parser, that's why i used it instead of a typeof operator syntax, but that can be debated later.

@divarvel divarvel added this to the Datalog update milestone Oct 10, 2023
@divarvel divarvel moved this to Todo in biscuit v3.3 Oct 10, 2023
@divarvel divarvel moved this from Todo to Implementation in biscuit v3.3 Oct 10, 2023
@divarvel divarvel moved this from Implementation to Design in biscuit v3.3 Oct 10, 2023
@divarvel divarvel moved this from Design to Done in biscuit v3.3 Dec 29, 2023
@Geal Geal changed the title typeof operator .type() function May 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

No branches or pull requests

1 participant