Standard Library · expr
class Field
A member access rooted at a lambda parameter, such as u.address.city.
since 0.1.0-alpha.1linuxwindowswasm
- bases
Node
Overview
A Field records only the member path; it does not say which lambda parameter the path starts from.
Examples
expr::Field f = expr::Field(["address", "city"]);
console.writeln(f.path[0] + "." + f.path[1]);
address.city
Constructors
new
new(Array<string> p)Create a field node.
Parameters
- p
- The member path, from the parameter outward.
Examples
expr::Field f = expr::Field(["user", "address", "city"]);
console.writeln(f.path.length());
console.writeln(f.path[2]);
3
city
Fields
path
Array<string> pathThe member names from the parameter outward, so u.address.city is ["address", "city"].
See also
- Node — The base class of every node in the reification tree.