Re: Announcement Loop Facility Ricardo G. Herdt 16 Aug 2022 10:22 UTC

Indeed, so no need to worry about broken code. But for clarity I
probably should use something else anyway.

Am 16.08.2022 12:17 schrieb Lassi Kortela:
>> Out of curiosity, do you plan to call it 'loop'? That will probably
>> break all my code, I should start renaming my named lets to 'lp' :)
>
> At least in R7RS, the following seems to work as intended:
>
> (import (scheme base) (scheme write))
>
> (define-syntax loop
>   (syntax-rules ()
>     ((loop . ignored)
>      (syntax-error "No loop for you!"))))
>
> (define (my-iota n)
>   (let loop ((n n) (list '()))
>     (let ((n (- n 1)))
>       (if (negative? n) list (loop n (cons n list))))))
>
> (write (my-iota 10))
> (newline)