Skip to main content

Tuple FieldSelection

rascal-0.34.0

Synopsis

Select a field from a node by its field name.

Syntax

Exp . Name

Types

ExpNameExp . Name
tuple[T₁ L₁, ..., Tₙ Lₙ]LᵢTᵢ

Description

Field selection applies to nodes with names keyword fields. Exp should evaluate to a node with field Name and returns the value of that field. Name stands for itself and is not evaluated.

Examples

rascal>tuple[int a, str b] T = <1,"hello">;
tuple[int a,str b]: <1,"hello">
rascal>T.a
int: 1
rascal>T.b
str: "hello"
---
hello
---