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.
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 atypeof
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:
using a
.type()
method call would integrate cleanly with the existing parser, that's why i used it instead of atypeof
operator syntax, but that can be debated later.