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

A named argument is name = value or name: value; both spellings work in every call, and they can mix.

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