Bob Nystrom
Bob Nystrom
Just trying some threads together. My latest proposal for pattern matching [does include a `switch` expression](https://github.com/dart-lang/language/blob/master/working/0546-patterns/patterns-feature-specification.md#switch-expression), which would address this.
The braces inside each case in your example are unnecessary, which would make the Dart example much nicer looking. You may also be interested in the in-progress proposal to add...
> Maybe some simple stuff like > > `if (foo?) // same as foo == null` > > `if (foo!) // same as foo != null` Given how heavily overloaded...
I'm not sure what the general behavior you're proposing is. There are plenty of other cases where a `?.` in a subexpression of an `if` condition does not imply that...
> Not sure who you're asking, but speaking for myself, whatever we do my number 1 requirement is that it has to be sound, and in all your examples there,...
> Not sure how to handle `??`, though. A `b ?? false` can only be non-`false` if `b` is non-`null`, but that's a very specific pattern It's very specific, but...
> It's not defined what happens if a named entry has the name `field1` and there is also a positional entry which would get that name, It should probably also...
> @munificent: could you please explain your preference for the name `fieldN` over the more traditional `$N`? Traditional according to what tradition? Using `$` in an identifier is always dubious...
> at least it's used in sh. Kind of :-) In my book, that's a signal to *not* do something. :) > I like `.n` notation. It's short and not...
> I'm actually somewhat interested in this syntax, and I would say that `a[i]` is a static error if `a` has a tuple type, and `i` is not an integer...