Talin
Talin
Also, I wonder to what extent @typing.sealed can be used as an optimization hint: for example, if we know that the set of match patterns are distinct and non-overlapping, then...
Having it check for a tuple of two equal items seems like the kind of thing that Haskell would do. Whether this is an argument in favor or against I...
Throwing an exception is a two-way door: we can always change it to one of the other alternatives later. Blindly assigning it, or using it as a comparison value, are...
A related question is whether f-string patterns should be explicitly disallowed in the initial implementation. They aren't actually literals, after all - they are evaluatable expressions.
I don't know what is the convention for Python, but in the environments I am used to this kind of thing is a lint error - the same as any...
Let's see what the other languages have to say: Rust: It's literally called "match arm". Huh. https://doc.rust-lang.org/reference/expressions/match-expr.html Scala: "case clause": https://docs.scala-lang.org/tour/pattern-matching.html F#: "when clause": https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/match-expressions Racket: just "clause": https://docs.racket-lang.org/reference/match.html How...
I would not expect `Point(1)` to match `Point(1, 2, 3)` - however, I would expect `Point(1, ...)` or `Point(1, _, _)` to match.
Also, as far as name matching goes: EIBTI. I still favor something like `?name` or `name?` for variables, even though it's an extra character, I think clarity beats brevity in...
Were I making a language today, I would not make strings implicitly iterable. Rather, I would have explicit `.chars()`, `.words()`, `.codepoints()` iteration methods.
Well, the one-off match syntax - with the no-exception fallback case - closely matches my experience with use cases in other languages that support matching. Also, although C++ has no...