From 53d6e51da8f7697404a9daf2882ee9a29bff60d1 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 19 Jan 2021 00:07:09 -0800 Subject: doc: fix defmacro example * txr.1: Fix the bungled dolist macro definition, as well as the incorrect example illustrating its usage. --- txr.1 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/txr.1 b/txr.1 index 34498d95..e4ccfeaa 100644 --- a/txr.1 +++ b/txr.1 @@ -35598,12 +35598,12 @@ as the original function call. ;; and return 42. ;; ;; (dolist (x '(1 2 3) 42) - ;; (format t "~s\en")) + ;; (format t "~s\en" x)) (defmacro dolist ((var list : result) . body) - (let ((i (my-gensym))) - ^(for ((i ,list)) (i ,result) ((set i (cdr i))) - (let ((,var (car i))) + (let ((i (gensym))) + ^(for ((,i ,list)) (,i ,result) ((set ,i (cdr ,i))) + (let ((,var (car ,i))) ,*body)))) .brev -- cgit v1.2.3