Lasse R.H. Nielsen

Results 772 comments of Lasse R.H. Nielsen

Ensuring that two independent types have "the same" API is not easy. It's true that with classes and interfaces, they can implement the same interface, but that gets tricky if...

You can do everything with a conditional expression, `?`/`:`, today that you would be able to do with `if` syntax, other than possilby not having an `else` branch. Which doesn't...

The example looks like it can just be ```dart x = condition ? y : null; ``` or if assigning `null` is a no-op: ```dart if (condition) x = y;...

If it only works for integers, I don't think it's worth doing. It's not trivial to make it work for anything else. The range itself can fairly easily be done...

Using `0:10` for the range is a problem if you want a set of ranges, because `{0:10}` is a map, not a set with a range. ("All the good syntax...

I'll admit that the only range syntax I'm even a little familiar with is Python, so `[start:end]`, with both ends being optional. Dart could introduce something like that. Special user...

If you can *add* a default value later, you can start by declaring ```dart class B extends A { void foo([int x]); } ``` in phase one, then add the...

Can an augmentation add a default value, if used by itself? I'd personally expect the choice of everywhere to have a default value, or at least which default value, to...

What we can do depends on which requirements we need to satisfy. If we cannot set a default value in a macro generated augmentation file which could not be written...

A set pattern is *possible*, but it would necessarily differ from list patterns and map patterns. A list pattern allows you to specify elements by (constant) index, or (constant) distance...