Clarified readme regarding named update.

This commit is contained in:
Linus 2020-11-02 22:20:52 +01:00
parent dd86fc8a0b
commit b3efccb4aa

View file

@ -70,7 +70,19 @@ You can of course still have a larger control of your loops:
;; => (-1 4 -9 16 -25 36 -49 64 -81 100)
```
Named updates have a bug, sadly.
Named updates have a bug, sadly, but works if there is only _one_ instance of the iteration macro. This doesn't curretnly work, but will in a little time:
```
;; Shamelessly stolen from Taylor Campbell's foof-loop documentation
(loop continue ((:for element (in-list list))
(:acc satisfied (in '()))
(:acc unsatisfied (in '())))
=> (values (reverse satisfied)
(reverse unsatisfied))
(if (predicate element)
(continue (=> satisfied (cons element satisfied)))
(continue (=> unsatisfied (cons element unsatisfied))))))
```
## Todo