brain icon indicating copy to clipboard operation
brain copied to clipboard

Tuples and Tuple Structs

Open sunjay opened this issue 9 years ago • 0 comments

Extension of #39 with support for arbitrary tuples.

Tuples can have heterogeneous types.

Tuples:

let foo: (u8, u16, u32) = (1, 10000, 1000000);

Tuple struct:

struct Foo(u8);

struct Foo(u8, u16);

Accessing tuple fields will use special number syntax like Rust.

// get
foo.0;
// set
foo.0 = 2;
  • [ ] Add numeric field access to grammar

sunjay avatar Feb 26 '17 15:02 sunjay