README: Change the doc on map/filter

This commit is contained in:
Cheer Xiao 2014-05-23 17:48:38 +08:00
parent 70f8be2952
commit e521871ef0

View File

@ -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: