let …​ = statement

The statement let <VAR> = <EXPRESSION> assigns the result of a single valued expression <EXPRESSION> to the variable <VAR>.

The expression can be a literal, an arithmetic expression, or a single valued function call.

If the function returns a tuple, multiple variables must be specified on the left hand side of the assignment.

Schema for the following examples
#!test[schema, commit]
define
fun minmax($a: integer, $b: integer) -> integer, integer:
match
{ $a <= $b; let $min = $a; let $max = $b; } or
{ $a > $b; let $min = $b; let $max = $a; };
return first $min, $max;
#!test[read]
match
  let $x, $y = minmax(3 * 5, 4 * 4);