else
> must have thought of this before, but I couldn't find the equivalent
> procedure. After reading 6.10.2 I came up with this
>
> (define-syntax repeat
> (syntax-rules (repeat)
> ((_ n exp exp* ...)
> '(unless (<= n 0)
> exp
> exp*
>
on to be happening
at run time. The target is to repeat the side effects of the
expressions n times, and the return values are irrelevant.
I think this last submission from Matt does exactly what I want, the
full version being
(define-syntax repeat
(syntax-rules ()
((_ n exp exp* .
th a list. It seems like somebody else
> must have thought of this before, but I couldn't find the equivalent
> procedure. After reading 6.10.2 I came up with this
>
> (define-syntax repeat
> (syntax-rules (repeat)
> ((_ n exp exp* ...)
> '(unless (<= n 0)
>
> On Nov 25, 2017, at 6:47 AM, Matt Wette wrote:
>
> you probably want named let
>
> ((_ n exp exp* ...)
> (let loop ((n n))
> (unless (<= n 0)
>exp exp* ...
>(loop (1- n)))
but not a broken one
((_ n exp exp* ...)
(let loop ((cnt n))
(unless (<=
ealing with a list. It seems like somebody else
> must have thought of this before, but I couldn't find the equivalent
> procedure. After reading 6.10.2 I came up with this
>
> (define-syntax repeat
> (syntax-rules (repeat)
> ((_ n exp exp* ...)
else
> must have thought of this before, but I couldn't find the equivalent
> procedure. After reading 6.10.2 I came up with this
>
> (define-syntax repeat
> (syntax-rules (repeat)
> ((_ n exp exp* ...)
> '(unless (<= n 0)
> exp
> exp*
>
6.10.2 I came up with this
(define-syntax repeat
(syntax-rules (repeat)
((_ n exp exp* ...)
'(unless (<= n 0)
exp
exp*
...
(repeat (- n 1) exp exp* ...)
Which doesn't work I think because repeat gets expanded infinitely many
times. I was pondering ot