Skip to content

Records

A record is a named bundle of fields. Build one with named arguments and read fields with ::.

record Item:
  name: String
  price: Currency
  qty: Integer
coffee = Item(name = "coffee", price = $4.50, qty = 20)
coffee::price * coffee::qty

Records can nest, and a record name works as a hint on a function parameter.