Skip to main content

Relation FieldSelection

rascal-0.34.0

Synopsis

Select a field (column) from a relation value.

Syntax

Exp . Name

Types

ExpExp . Name
rel[T₁ L₁, T₂ L₂, ... ]set[Tᵢ]

Description

Exp should evaluate to a relation that has an i-th field label Lᵢ that is identical to Name. Return a set with all values of that field. Name stands for itself and is not evaluated.

Examples

rascal>rel[str street, int nm] R = {<"abc", 1>, <"abc", 2>, <"def", 4>, <"def", 5>};
rel[str street,int nm]: {
<"abc",1>,
<"abc",2>,
<"def",5>,
<"def",4>
}
rascal>R.street;
set[str]: {"abc","def"}