cast
relationalai.semantics.std.common
cast(target_type: Concept, value: Value) -> ExpressionCast a value to the given target type.
The target type is passed to the core cast relation as a meta-reference so the frontcompiler lowers it as a type node rather than as a normal value.
Parameters
Section titled “Parameters”
(target_typeConcept) - The target type to cast to, such asInteger,String, orNumber.size(10, 2).
(valueValue) - The value to cast.
Returns
Section titled “Returns”Expression- AnExpressionrepresenting the cast value.
Examples
Section titled “Examples”Cast a value to an integer:
common.cast(Integer, Employee.age_text)Cast to a sized number type:
common.cast(Number.size(10, 2), Invoice.amount_text)