mirror of
https://github.com/go-sylixos/elvish.git
synced 2024-11-28 07:21:21 +08:00
README: Change the doc on map/filter
This commit is contained in:
parent
70f8be2952
commit
e521871ef0
|
@ -170,13 +170,14 @@ And:
|
|||
> filter {|x| > $x 2} [1 2 3 4 5]
|
||||
[3 4 5]
|
||||
> map {|x| * 2 $x} (filter {|x| > $x 2} [1 2 3 4 5])
|
||||
[6 8 10]
|
||||
```
|
||||
|
||||
* Get rid of lots of irritating superfluous parentheses with pipelines (`put`
|
||||
is the builtin for outputting compound data):
|
||||
```
|
||||
> put [1 2 3 4 5] | filter {|x| > $x 2} | map {|x| * 2 $x}
|
||||
[6 8 10]
|
||||
> put 1 2 3 4 5 | filter {|x| > $x 2} | map {|x| * 2 $x}
|
||||
6 8 10
|
||||
```
|
||||
|
||||
* Use the table `$env` for environmental variables:
|
||||
|
|
Loading…
Reference in New Issue
Block a user