mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-12-05 03:17:50 +08:00
Document using "range n | each" to execute something n times.
This addresses #1433.
This commit is contained in:
parent
8cbd39f006
commit
c1adf58b6d
|
@ -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).
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user