forked from orion/obsidian
485 B
485 B
let .. in ..
is an expression with some scoped variables, separated by newlines:
let
a = 1
b = 2
in
a + b
Tip
there is a second local let-binding syntax,
where
:a + b where a = 1 b = 2
Examples
Recursive Fibonacci generator, using a helper function go
fib n =
let
go ns a b =
if Array.length ns == n then
ns
else
go (ns <> [a]) b (a + b)
in
go [] 1 1