guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Announcing the first actually stable release of guile-for-loops


From: Arne Babenhauserheide
Subject: Re: Announcing the first actually stable release of guile-for-loops
Date: Fri, 24 Jan 2020 09:16:38 +0100
User-agent: mu4e 1.2.0; emacs 26.1

Hi,

Linus Björnstam <address@hidden> writes:
> The syntax is more or less the same as racket's loops, and they are generally 
> compatible. The code generated is for almost all cases as fast as hand-rolled 
> code. They are all expressed as left or right folds, and are as such (apart 
> from for/list, but read about that in the documentation) free of mutation. 
> They are all converted to named lets.

That’s cool!

> (define (erathostenes n)
>   (define vec (make-vector n #t))
>   (for/list ([i (in-range 2 n)] #:when (vector-ref vec i))
>     (for ([j (in-range/incr (* 2 i) n i)])
>       (vector-set! vec j #f))
>     i))
>
> The code and documentation is available here:
> https://hg.sr.ht/~bjoli/guile-for-loops

Is there a chance that this could get included in Guile (ice-9
for-loops?) and become a SRFI?

If the code is non-portable (I guess the #:keywords are), the two
existing implementations (Racket, Guile) would still be sufficient for a
SRFI.

Best wishes,
Arne
--
Unpolitisch sein
heißt politisch sein
ohne es zu merken



reply via email to

[Prev in Thread] Current Thread [Next in Thread]