bonobo-lang / bonobo

Strongly-typed, safe, opinionated systems language that compiles to C.
https://bonobo-lang.github.io
Apache License 2.0
14 stars 1 forks source link

Formal spec of destructuring assignments #73

Open thosakwe opened 6 years ago

thosakwe commented 6 years ago

Meta-issue to add these to the spec document.

// Destructure tuple
var (x, y) = myPoint

// Destructure struct
var { width, height, top, bottom } = myRect

These can actually work side-by-side with regular variable declarations:

var
  { text, type, line, column } = myToken,
  span = source_span::FileSpan(line, column, text)