Lasse R.H. Nielsen
Lasse R.H. Nielsen
The reason the hacky version seems efficient is probably that it's actually backed by a list. If you know that, you can just use list patterns. Try a larger example...
Sadly `toPrint ?? print(toPrint)` does the opposite of what was asked for - it calls `print`only when `toPrint` is `null`. A shorter `null` guard, like the one requested in #361,...
Another extension method option is to extend a unary function: ```dart extension Exists on R Function(T) { R? ifArg(T? argument) => argument == null ? null : this(argument); } void...
I'd say that they run in "generalized source order", which is the same thing as augmentation application order, plus source order within the individual declarations. (I never expected anything other...
I actually think we *should* define the meaning of the representation variable as a getter. Something like: > An extension type declaration of the form extension type constopt Name opt...
ACK. An `external` declaration is a complete declaration when augmenting, it adds implementation. You should be able to do: ```dart augment external ``` If you can augment that declaration otherwise,...
Issue dart-lang/sdk#18516 has been merged into this issue. --- cc @floitschG.
You can't get proper typing with extension operators. If you define it as: ```dart extension PipeExt on T { operator |(Function(T) f) => f(this); } ``` you can't get the...
You can definitely do something similar to a function pipe by writing sufficiently many extension methods. It doesn't easily allow you to simply pipe into an existing top-level function, like...
It's a good point that having an easy currying syntax makes it less important to include it in the pipe itself. So, instead of: ```dart expr->foo(2); // meaning foo(expr, 2),...