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: Tue, 13 Sep 2022 16:25:46 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16741"; 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 Tue Sep 13 16:28:50 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 1oY6uA-00049N-1E for guile-user@m.gmane-mx.org; Tue, 13 Sep 2022 16:28:50 +0200 Original-Received: from localhost ([::1]:36026 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oY6u8-0003eq-MG for guile-user@m.gmane-mx.org; Tue, 13 Sep 2022 10:28:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41478) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oY6rT-0008I5-S3 for guile-user@gnu.org; Tue, 13 Sep 2022 10:26:03 -0400 Original-Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:40649) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oY6rR-0006fK-TL for guile-user@gnu.org; Tue, 13 Sep 2022 10:26:03 -0400 Original-Received: by mail-lf1-x129.google.com with SMTP id s6so9179929lfo.7 for ; Tue, 13 Sep 2022 07:26:00 -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=yO16yYWb5bDcjFimo0vRMEaxQzflICQLWXOZFbLBSBM=; b=Bcw12vgAlPiv46riqVxQ5gU4N69NnrCPYCz9rhimyVwybxG4dwMNQTv7OG++bkLiGA eM/qU5eO9dUI3aGPxGaJdfr1k8xYRQJMF57jJTVkSPUMe06AbbpeLlUNgvHtZ2IUFOG6 t4BiyZsv5PrU/yYIusl1upIkyNVHXiEF9AUkdCxz6k9gEK84J2llwwA9h2HqBu7kZJ+s EZv4uckj5ltZZnna7Y0QhbpSwHDcebrC7sQZz3ven5+WX3zFmWeZU8JZaxGZEzpB0Y56 jpQzEWCO+5CMpCBLxpe+0fA2lZ1gGxymgAf2KqZ1p7TgMgb0jhOlYKJgfKWarDNi2XPv Uz7w== 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=yO16yYWb5bDcjFimo0vRMEaxQzflICQLWXOZFbLBSBM=; b=CTk9Tr6fTSi/vagahTwrtIRxcomPK6vYlBJKE7gZvgaHE/G2fckkmWYm9TxS8aCNEa QpQUN1G65hlJv7S2SuUplp6Qw9HdFFUcOei3XX6rGAjN2t4hJ0HCgxMttPsh0eBsOaIH 7sIHYYeURHi0wcty7jWiJ8Q8GHkJ5NkV5XiprpUqxTv4J715sCbpIvjPaz4lfmHg4vzE q2G5jKdFA1ECA+03TldRvZTU/sWr2IkDKCwXwliB8493Gs/De8S/osx5DrPFaB1gor5v W25guRqjkVhj1LmMPk+/6AZcPE8CsJzlN86cVYwgEy1uZF+pfVimeIRpsiDI48SwaB+v 0zwA== X-Gm-Message-State: ACgBeo1YVSF2gN9i7JAh7JyqCrpnXOdeb2SQr7grVo6Y2k4xkCjDm5hY 9x2QYnWyBWxvYvY6arKAL3r0H5QAo3NcCLVUcQk= X-Google-Smtp-Source: AA6agR6RQBv+mBAkOrL490IJgMsdeFd9/HbU+lJ9xg3N+aE1P8FgwsGUbIdmi86hL/Y8R3AExbzCgqh4vB+VitP3YKk= X-Received: by 2002:a19:6b01:0:b0:499:b6fb:fcf2 with SMTP id d1-20020a196b01000000b00499b6fbfcf2mr4696027lfa.622.1663079157461; Tue, 13 Sep 2022 07:25:57 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::129; envelope-from=damien.mattei@gmail.com; helo=mail-lf1-x129.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:18589 Archived-At: do you have any examples of use? that illustrate the features ,just with the code it is not easy. Regards, Damien On Mon, Sep 12, 2022 at 10:57 PM Maxime Devos wrote: > > > On 12-09-2022 21:19, Linus Bj=C3=B6rnstam 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 on= e > 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 u= p. > > > > Best regards > > Linus Bj=C3=B6rnstam > > 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.sc= m > > 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. >