unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Damien Mattei <damien.mattei@gmail.com>
To: Maxime Devos <maximedevos@telenet.be>
Cc: "Linus Björnstam" <linus.internet@fastmail.se>,
	"Jean Abou Samra" <jean@abou-samra.fr>,
	"Guile User" <guile-user@gnu.org>
Subject: Re: Loop macros (was: Re: macro definition for continue and break)
Date: Wed, 14 Sep 2022 17:56:14 +0200	[thread overview]
Message-ID: <CADEOaddS-Nev--MG9HOqLr5Dms62ZZNwoYOgZk5OiM4fgkQxdA@mail.gmail.com> (raw)
In-Reply-To: <6c574aa4-8606-643a-0836-d37b6c85f8fc@telenet.be>

thank you, i had a look directly on the web site, but since a few days i'm
just using a single 'repeat ... until macro of my own (directly inspired
from Pascal :-) if i do not mistake... and where i can put local define or
just make mutations.

;; scheme@(guile-user)> {i <+ 5}
;; scheme@(guile-user)> (repeat (display i) (newline) {i <- {i - 1}} until
{i < 0})
;; 5
;; 4
;; 3
;; 2
;; 1
;; 0

(define-syntax repeat
  (syntax-rules (until)
    ((repeat b1 ...
       until pred)
     (let loop () b1 ... (when (not pred) (loop))))))


regards,
damien

On Tue, Sep 13, 2022 at 4:28 PM Maxime Devos <maximedevos@telenet.be> wrote:

>
>
> On 13-09-2022 16:25, Damien Mattei wrote:
> > do you have any examples of use? that illustrate the features ,just with
> > the code it is not easy.
>
> "git grep -F let^" inside the repo.  More specifically, parse-expandable
> from (gnu gnunet config parser), though there are other uses too.
>


  reply	other threads:[~2022-09-14 15:56 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         ` Loop macros (was: Re: macro definition for continue and break) Maxime Devos
2022-09-12 21:09           ` Linus Björnstam
2022-09-13 14:25           ` Damien Mattei
2022-09-13 14:28             ` Maxime Devos
2022-09-14 15:56               ` Damien Mattei [this message]
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=CADEOaddS-Nev--MG9HOqLr5Dms62ZZNwoYOgZk5OiM4fgkQxdA@mail.gmail.com \
    --to=damien.mattei@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=jean@abou-samra.fr \
    --cc=linus.internet@fastmail.se \
    --cc=maximedevos@telenet.be \
    /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).