mirror of
https://github.com/zeroflag/fcl.git
synced 2025-01-11 20:01:10 +01:00
Update README.md
This commit is contained in:
parent
fccf6763ce
commit
92444248c2
1 changed files with 6 additions and 3 deletions
|
@ -220,15 +220,18 @@ Lists are java.util.LinkedHashMap instances and garbage collected automatically
|
||||||
## Collection operations
|
## Collection operations
|
||||||
|
|
||||||
```forth
|
```forth
|
||||||
[ 1 2 3 4 ] { . } each \ iterets through the list and calls the quotation on each element
|
\ iterets through the list and calls the quotation on each element
|
||||||
|
[ 1 2 3 4 ] { . } each
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```forth
|
||||||
[ 1 2 3 4 ] { odd? } filter \ selects only the odd items from the list [ 1 3 ]
|
\ selects only the odd items from the list [ 1 3 ]
|
||||||
|
[ 1 2 3 4 ] { odd? } filter
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```forth
|
||||||
[ 1 2 3 4 ] { dup * } map \ transforms the list to a new list that contain the squares of the original items [ 1 4 9 16 ]
|
\ transforms the list to a new list that contain the squares of the original items [ 1 4 9 16 ]
|
||||||
|
[ 1 2 3 4 ] { dup * } map
|
||||||
```
|
```
|
||||||
|
|
||||||
```forth
|
```forth
|
||||||
|
|
Loading…
Reference in a new issue