From: Maxime Devos <maximedevos@telenet.be>
To: "Linus Björnstam" <linus.internet@fastmail.se>,
"Jean Abou Samra" <jean@abou-samra.fr>,
"Damien Mattei" <damien.mattei@gmail.com>
Cc: Guile User <guile-user@gnu.org>
Subject: Loop macros (was: Re: macro definition for continue and break)
Date: Mon, 12 Sep 2022 22:57:05 +0200 [thread overview]
Message-ID: <f48f1895-b083-28e5-c1f3-9854e5f7e41c@telenet.be> (raw)
In-Reply-To: <e160ebd0-aa5d-42ce-bed8-26204b712836@www.fastmail.com>
[-- Attachment #1.1.1: Type: text/plain, Size: 1108 bytes --]
On 12-09-2022 21:19, Linus Björnstam wrote:
> If you want a bit more advanced looping you could have a look at my goof-loop: https://git.sr.ht/~bjoli/goof-loop
>
> It currently does not support a break or continue clause, but adding one should not really be a problem.
>
> A good thing is that it does not rely on mutation for anything except higher order sequences, meaning it does not lead to the implicit boxing overhead of set!, which is a good idea in loops since that quickly adds up.
>
> Best regards
> Linus Björnstam
I also have a mutation-free loop macro, named 'hat-let' or 'let^':
https://git.gnunet.org/gnunet-scheme.git/tree/gnu/gnunet/utils/hat-let.scm
Its origin is rather different though, goof-loop appears to be the
result of combining various loop-related constructs, plus some extras,
whereas let^ is the result of combining various binding constructs
(including the 'let loop'), plus some extras.
It combines the following: let*, lambda / define, receive, 'let loop',
'if', 'begin'.
Doesn't do any accumulation though.
Greetings,
Maxime.
[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 929 bytes --]
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 236 bytes --]
next prev parent reply other threads:[~2022-09-12 20:57 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-04 8:19 macro definition for continue and break Damien Mattei
2022-09-04 10:08 ` Jean Abou Samra
[not found] ` <CADEOadd2OAL-Z4o9AAR_mQ5_NSjCA1tVz5cDgeufVZ=ocAx0vQ@mail.gmail.com>
2022-09-04 11:13 ` Jean Abou Samra
2022-09-12 19:19 ` Linus Björnstam
2022-09-12 20:57 ` Maxime Devos [this message]
2022-09-12 21:09 ` Loop macros (was: Re: macro definition for continue and break) Linus Björnstam
2022-09-13 14:25 ` Damien Mattei
2022-09-13 14:28 ` Maxime Devos
2022-09-14 15:56 ` Damien Mattei
2022-09-13 14:16 ` macro definition for continue and break Damien Mattei
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=f48f1895-b083-28e5-c1f3-9854e5f7e41c@telenet.be \
--to=maximedevos@telenet.be \
--cc=damien.mattei@gmail.com \
--cc=guile-user@gnu.org \
--cc=jean@abou-samra.fr \
--cc=linus.internet@fastmail.se \
/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).