patma
patma copied to clipboard
Pattern Matching
`**_` in a mapping pattern and `_ :=` in a named pattern don't seem like they could ever make sense. I think we should be consistent, and *always* ignore stores...
It is useful to be able to match against both the type *and* the value of a target. Currently, the only way to do this is to manually assign `self`...
We may be able to make more powerful optimizations possible in the future if we clearly and explicitly state that there are no guarantees as to the order (or number...
We've been using `case`, like this: ``` match target: case Point(x, y): ... case Rectangle(x0, y0, x1, y1): ... ``` @ilevkivskyi proposes `as`, like this: ``` match target: as Point(x,...
Despite the immense power of pattern matching to express ideas, there is one kind of use cases that is hardly captured so far: parametrized patterns. The idea is that in...
Probably not very important, but while reading code it looks like a negative match may be useful. For example, when people write something like `not isisnstance(x, Foo) or x.y !=...
Rust is going to [disallow float literals](https://github.com/rust-lang/rust/issues/41620) in patterns. We should probably never accept them.
Just found these in F#: https://docs.microsoft.com/en-us/dotnet/fsharp/language-reference/pattern-matching#and-pattern This is a simple extension of the `|` (OR) pattern -- e.g. we could write ``` case [x, y] & [0|1, 0|1]: print("Two bits:",...
@brandtbucher proposed to support `continue` in case blocks, with the semantics of skipping forward to the next case. This could be used instead of guards (#3). E.g. ``` match [randint(1,...
Arguably indenting case statements under the head match should not be done: 1. Other "decision statements" - if/elif/else and try/except - line up vertically. Code like the following from asyncio...