
Things you can’t do in Rust: destructure function arguments in declaration - andrew-lucker
https://medium.com/@andrew_subarctic/things-you-cant-do-in-rust-destructure-function-arguments-in-declaration-51f631aa3f3e
======
arh68
> shorthand for a function with only a pattern as its body.

Only an _expression_ as its body seems more like it.

Just to be clear, would you require the last function clause to be a catch-
all/wildcard pattern? Or could you just define a function on 0 & 1? Separate
question: would you want to be able to add a new clause for your function f
_below_ main? It's okay to want either outcome, I'm just curious. Third
question: would you want/accept a delimiter between a function's clauses like
; or | ?

I like the idea. Especially if you can still refer to pattern-matched
parameters by name, too.

~~~
andrew-lucker
Not married to the syntax, just wanted to highlight the absence of this syntax
form. The syntax used was mainly meant to mirror the existing Rust pattern
syntax.

As for partial matching, other languages give warnings or errors if a pattern
doesn't cover all cases.

