From b3efccb4aa2dffe1f6e5343d840c33221fed95c2 Mon Sep 17 00:00:00 2001 From: Linus Date: Mon, 2 Nov 2020 22:20:52 +0100 Subject: [PATCH] Clarified readme regarding named update. --- README.md | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9b6bc3d..7f08b97 100644 --- a/README.md +++ b/README.md @@ -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