Guide
Records
Nominal product types with named-field construction in declaration order — one canonical way to build a value.
record User:
name: Text
age: Int
/// Renders a short profile line.
pub fn profile(u: User) -> Text:
return "{u.name} ({u.age})"
fn main() -> Void:
mut u = User(name: "Ada", age: 36)
u.age = u.age + 1
print(profile(u))
print("{u}")$ ptc run records.pt
Recorded output of the real compiler
Fields are written in declaration order, always all of them, always named — wrong order is a teaching error that prints the canonical form. Records print as constructor syntax, so debug output is valid source.