From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Damien Mattei Newsgroups: gmane.lisp.guile.user Subject: Re: Loop macros (was: Re: macro definition for continue and break) Date: Wed, 14 Sep 2022 17:56:14 +0200 Message-ID: References: <6c574aa4-8606-643a-0836-d37b6c85f8fc@telenet.be> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="1686"; mail-complaints-to="usenet@ciao.gmane.io" Cc: =?UTF-8?Q?Linus_Bj=C3=B6rnstam?= , Jean Abou Samra , Guile User To: Maxime Devos Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Wed Sep 14 17:56:55 2022 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYUkx-0000D7-PL for guile-user@m.gmane-mx.org; Wed, 14 Sep 2022 17:56:55 +0200 Original-Received: from localhost ([::1]:45584 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oYUkw-0005ZB-Lr for guile-user@m.gmane-mx.org; Wed, 14 Sep 2022 11:56:54 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39168) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oYUke-0005Yw-81 for guile-user@gnu.org; Wed, 14 Sep 2022 11:56:36 -0400 Original-Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]:41650) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oYUkc-0002GL-Lm for guile-user@gnu.org; Wed, 14 Sep 2022 11:56:36 -0400 Original-Received: by mail-lj1-x22e.google.com with SMTP id a14so16698904ljj.8 for ; Wed, 14 Sep 2022 08:56:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=EvOrCCDNogsY2xkV0vXiDl8Dh+dNVvY8HyAzK6mo85w=; b=DSsYUGau6ebs2LS2Qhxu3+zc9uYCcchuYpEKKSAyUoeQPnFmD0HvFbZY8bZd9aa9tK /TYptI14JgvTSqJdLXtbZ0VnSlV87LveTTx4p6GOwrlhTUi5zINPyryQyNUHAJTzdhdc 3qRDR3Zi4ANzVIhA2d6d+awtCCV5dJ3vQk5qiAjXnzb9c9r8ZmXdpOXpKXGCLXL9e2Wh p9zP5Uoeaib9laVWkW4YrtJeKvCF5yCs50f69p5jE7yznr1THJndQrnEkPKpJ2i4NUiU C+FQ3rVCdwysGSFetMgPeXkm2sJz/zVzIsn90LhAdCAGdJU/or9ZgMKNx+UPUZDG7qDi 2kQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=EvOrCCDNogsY2xkV0vXiDl8Dh+dNVvY8HyAzK6mo85w=; b=rusWy56sFlIGz5011D68ZIi0YI/Wf6ccQMZq817XZN9cAsCn+1roAujjVdx9ShKz/V AKWCeC2A1K+hJCzlpdbfqOb6pBmZXOsmrR5vskwX0YVApAS+XUAyDg3NK2TEcVPSnN37 slKGynhE/fZEo3krWYDYFx+EG88zONK29X5aemqMvowm1scteeE/kyPSB+jsFc3Au4C7 FtZ4RJldhUFCgd86f1DCekoUSPwgyklOLXamumskZt26U2x9hnrbx/h2J9tqtBPLM7UF DPvtS46nEjguiLikVpV8pCN9F0rSpbMP5MrEzek1grUKcDuIfDmpZyH7BHMyQEi6X3HC +dtg== X-Gm-Message-State: ACgBeo2bvuHljkT/kPZDWzS39fe4W3jKd5NgYZKaLrTrKYMK+it9P7Mf S8w/MN/3HDDJTyens2HOFVvXRAFHSfWwEeUyP3g= X-Google-Smtp-Source: AA6agR6df1E99U5V72+MOrSutLiL0odHFFuNj/VFkcDeoZumiK7hLvaLZIAn3HL3sDDl3DDMehFxGh2gBrM9QK3P2LA= X-Received: by 2002:a2e:a801:0:b0:261:91a3:bc44 with SMTP id l1-20020a2ea801000000b0026191a3bc44mr10774962ljq.497.1663170986085; Wed, 14 Sep 2022 08:56:26 -0700 (PDT) In-Reply-To: <6c574aa4-8606-643a-0836-d37b6c85f8fc@telenet.be> Received-SPF: pass client-ip=2a00:1450:4864:20::22e; envelope-from=damien.mattei@gmail.com; helo=mail-lj1-x22e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:18592 Archived-At: 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 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. >