brain icon indicating copy to clipboard operation
brain copied to clipboard

User Defined Structs

Open sunjay opened this issue 9 years ago • 0 comments

Support basic struct syntax including nested structs:

struct Foo {
    x: u8,
    y: u8,
}

struct Bar {
    pos: Foo,
    data: u8,
}

struct Unit;

Memory layout will likely be sequential though we shouldn't put any guarantees on ordering. This is essentially a way to group variables when passing them around to functions.

  • [ ] Be able to use structs where other types used to be used (arrays, functions #16, etc.)
  • [ ] Struct names cannot be paths
  • [ ] Struct names cannot be keywords

sunjay avatar Feb 26 '17 15:02 sunjay