From: Arne Babenhauserheide <arne_bab@web.de>
To: guile-user@gnu.org
Subject: Re: Announcing the first actually stable release of guile-for-loops
Date: Fri, 24 Jan 2020 09:16:38 +0100 [thread overview]
Message-ID: <8736c546c9.fsf@web.de> (raw)
In-Reply-To: <f536f849-5266-40d6-a3dc-f815834a0d30@www.fastmail.com>
Hi,
Linus Björnstam <linus.internet@fastmail.se> 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
next prev parent reply other threads:[~2020-01-24 8:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-01-23 12:10 Announcing the first actually stable release of guile-for-loops Linus Björnstam
2020-01-24 8:16 ` Arne Babenhauserheide [this message]
2020-01-24 21:02 ` Linus Björnstam
[not found] <mailman.81.1579798810.6198.guile-user@gnu.org>
2020-01-23 23:22 ` Zelphir Kaltstahl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8736c546c9.fsf@web.de \
--to=arne_bab@web.de \
--cc=guile-user@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).