Functions¶
Give work a name, pass values in and out, treat functions as values, and produce sequences lazily.
- FunctionsDeclare reusable work with
fun, parameters, and return types. - Function parametersDefaults, named arguments, repeated arguments, and borrowing.
- Function valuesStore and pass functions, and capture surrounding values in closures.
- Yield and iteratorsProduce lazy sequences one element at a time with
yield.