(iter (for x in '(1 -3 2))
(finding x maximizing (abs x))) => -3
The cool thing about ITERATE is that it lets you express looping
concepts in a language designed explicitly for such a purpose, e.g.
(iter (for x in '(1 3 3))
(summing x)) => 7
Bill Atkins wrote:
The cool thing about ITERATE is that it lets you express looping
concepts in a language designed explicitly for such a purpose, e.g.
(iter (for x in '(1 3 3))
(summing x)) => 7
Scheme
(fold + 0 '(1 3 5 7 9))
===>
25
(iter (for x in '(1 -3 2))
(finding x maximizing (abs x))) => -3
| Sysop: | Keyop |
|---|---|
| Location: | Huddersfield, West Yorkshire, UK |
| Users: | 715 |
| Nodes: | 16 (2 / 14) |
| Uptime: | 143:34:07 |
| Calls: | 12,089 |
| Calls today: | 2 |
| Files: | 15,000 |
| Messages: | 6,517,474 |