Lasse R.H. Nielsen

Results 772 comments of Lasse R.H. Nielsen

The behavior of `for(;;)` loops is ... intricate. I believe there was originally a semantics where there was a separate loop variable outside of the body, and the body introduced...

This may be worthy of a more general feature. Consider an "optional pattern", where `p??` matches the matched value against the pattern `p` of the value is non-null, but _accepts_...

Ad 1: ``` extension type Level._(int value) { Level(this.value) { RangeError.checkValueInInterval(value, 1, 20); } } ``` You need the "primary constructor" declaration as part of the type declaration, but you...

If we change `Pointer` to be an extension type wrapping an `int`, then `2 is Pointer` will be true. Because it is a pointer, if you want it to be....

We could consider how [LINQ in C#](https://learn.microsoft.com/en-us/dotnet/csharp/linq/) works. It allows you to write expressions into LINQ queries, like `from ... where x> y select x.foo + 42`. That can be...

Partial evaluation is basically [Kleene's S-m-n theorem](https://en.wikipedia.org/wiki/Smn_theorem): For a program (function) taking m+n inputs and a given m inputs, there is a corresponding program taking n inputs which behaves as...

The easy way to write this is to have each subtype implement `select` again: ```dart class SomeModel extends ChangeNotifier { final String name; SomeModel(this.name); R select(R Function(SomeModel) selector) => selector(this);...

It's similar to nullability because both are union types, and both have a second part which is _mostly_ untyped. (You could type the error, but most of the time you...

> I see a difference here. `Error`s are meant to be thrown and stop the flow of the program. Those are control flow entities. But `Exception`s were always meant to...

I think that with extension types, we'll see new implementations of the existing `Result` (and `Option`) types, and probably other stable helper types. Consider something like this (slightly hackish) version;...