George Kastrinis
06 October 2021
less than a minute read
The Standard Library now offers the Any
function. This is a unary relation that is true for any value used. It is used as a generic type assertion that always succeeds.
In the following example, we define a relation R
that contains tuples of various lengths (arities). In the second line we output the second argument of all the tuples in R
that have arity 3. By using Any
in the first and third position, we declare that we are not interested in the values of these arguments:
def R = {(1, 2, 3); ("a", 3, 0.5); (11, 22, 33, 44)}
def output = x : R(Any, x, Any)
Relation:
2 |
3 |
We are excited to announce worksheets, a new interface for submitting Rel queries. Worksheets allow you to develop blocks of Rel code and run them against a database. They can be shared with other users using their URLs.
Read MoreWe are excited to announce the support of varargs in Rel. You can use varargs to write more general code that works for multiple arities. Varargs can be useful when writing generic relations for common utilities.
Read MoreValue types help distinguish between different kinds of values, even though the underlying representation may be identical. Value types can be used to define other value types.
Read More