|
|
|
|
|
by arh68
3114 days ago
|
|
> 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. |
|
As for partial matching, other languages give warnings or errors if a pattern doesn't cover all cases.