Document using "range n | each" to execute something n times.

This addresses #1433.
This commit is contained in:
Qi Xiao 2021-12-08 00:32:32 +00:00
parent 8cbd39f006
commit c1adf58b6d

View File

@ -202,6 +202,16 @@ func makeMap(input Inputs) (vals.Map, error) {
// ▶ (num 3/5)
// ```
//
// One usage of this command is to execute something a fixed number of times by
// combining with [each](#each):
//
// ```elvish-transcript
// ~> range 3 | each {|_| echo foo }
// foo
// foo
// foo
// ```
//
// Etymology:
// [Python](https://docs.python.org/3/library/functions.html#func-range).