Here is a summary of the proposed text format changes.

**RefCreate**: `ref(n)`
**RefWrite**: `r := v`
**RefRead**: `!r`
**ADTs**:
```
type myVariant =
  | HasNothing
  | HasSingleInt(int)
  | HasSingleTuple((int, int))
  | HasMultipleInts(int, int)
  | HasMultipleTuples((int, int), (int, int))
```
**Pattern Matching**:
```
match (x) {
  | HasNothing => 0
  | HasSingleInt(x) => 0
  | HasSingleTuple((x, y)) => 0
  | HasMultipleInts(x, y) => 0
  | HasMultipleTuples((x, y), (q, r)) => 0
}
```
**Generics**
```
type Option[A] =
  | Some(A)
  | None

fn takes_anything[T](%x: T) {
    // do something with %x
}

let x = Some[i32](5);
let x = Some[i64](5);
```
**TupleGetItem**: `("foo", 2, true).0 // "foo"`
**Semicolons**: optional unless collapsing multiple lines into one as in Python
**Attrs**: We still don't have a satisfying answer for this so we may punt it. 
We will default to Tianqi's suggestion of `attrs=ValueFormat` where we allow 
different options for `ValueFormat`.

**Please vote on these changes.** This will allow us to nearly solidify the 
text format.
cc @tqchen @MarisaKirisame @jroesch @wweic @vinx13 @junrushao1994 @nhynes


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/dmlc/tvm/issues/3016#issuecomment-504065532

Reply via email to