We propose new syntax for do/anonymous function block,
which is equivalent to
This syntax makes it easy to pass blocks to a function.
foo do { ... }, i -> { ... }, j -> {
...
}, k -> {
... # no indentation allowed
}
The { immediately after do, ->(=>) is not considered to be the { of a brace container (set, record, dict).
i -> { i + 1 } # : Nat -> Nat
i -> { {i + 1} } # : Nat -> Set Nat
k = 3
do { i = 1; j = 2; k } # : () -> Nat
do { { i = 1; j = 2; k } } # : () -> { i = Nat; j = Nat; k = Nat }
We propose new syntax for
do/anonymous function block,which is equivalent to
This syntax makes it easy to pass blocks to a function.
The
{immediately afterdo, ->(=>) is not considered to be the{of a brace container (set, record, dict).