22 ms·
C# now has active patterns (which feel like the `is` pattern matching) in the ability to declare a variable as you pass it as an out parameter to an extension f
by victorNicollet 8y ago
C# now has active patterns (which feel like the `is` pattern matching) in the ability to declare a variable as you pass it as an out parameter to an extension function, e.g.
if (num.IsNotPrime(out var a, out var b))
WriteLine($"{num} = {a} × {b}");