Builtin

to_rel

to_rel(a)

Returns the value of a converted to a relation. a must be a tuple or a table.

Examples

tuple literal
to_rel(tuple{a:=42, b:="test"})
ab
42test

Note: this is the inverse of the .tuple tuple extraction.

Note: a shorthand syntax for tuple literals is to compose the sequence of scalar assignments with dee, which removes the need for to_rel, e.g.

dee(a:=42, b:="test")
ab
42test


tuple
to_rel($S[SNO="S3"].tuple)
SNOSNAMESTATUSCITY
S3Blake30Paris

table
to_rel($S#)
SNOSNAMESTATUSCITY
S1Smith20London
S2Jones10Paris
S3Blake30Paris
S4Clark20London
S5Adams30Athens

Note: this loses the table tuple ordering.