|
|
|
|
|
by Blikkentrekker
1870 days ago
|
|
With function calls, yes. What makes it different is that syntactic constructs are also expressed with the same syntax and there is no special syntax, so control flow constructs use a syntax similar to function calls. This is particularly exuberant in Arc where what in many languages would be: if (<cond1>) {
<then expr1>
} else if (<cond2>) {
<then expr2>
} else if (<cond3>) {
<then expr3>
} else {
<else expr>
}
Would instead be: (if
<cond1> <then expr1>
<cond2> <then expr2>
<cond3> <then expr3>
<else expr>)
Note the complete lack of syntax beyond a keyword having 7 arguments in order, which many find nonconsecutive to reading, and also error prone as accidentally making a typo can completely change the meaning of the program.It is thus that most Lisps have somewhat more redundant syntax: (cond
[<cond1> <then expr1>]
[<cond2> <then expr2>]
[<cond3> <then expr3>]
(else <else expr>))
Personally, I wouldn't mind that a mandatory `->` be required in between the conditions and the expression to further guard against accidental typos. I find that redundancy in syntax guards against accidental mistakes, though I have nothing against the parentheses and in fact favor them. |
|
https://doc.rust-lang.org/reference/expressions/match-expr.h...