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: macro definition for continue and break Date: Sun, 4 Sep 2022 10:19:14 +0200 Message-ID: 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="32076"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Sun Sep 04 10:19:43 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 1oUkr0-0008EG-RG for guile-user@m.gmane-mx.org; Sun, 04 Sep 2022 10:19:42 +0200 Original-Received: from localhost ([::1]:34964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oUkqz-0000bB-4Q for guile-user@m.gmane-mx.org; Sun, 04 Sep 2022 04:19:41 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:58676) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oUkqn-0000az-IV for guile-user@gnu.org; Sun, 04 Sep 2022 04:19:29 -0400 Original-Received: from mail-lf1-x132.google.com ([2a00:1450:4864:20::132]:45047) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oUkql-0001cG-Qx for guile-user@gnu.org; Sun, 04 Sep 2022 04:19:29 -0400 Original-Received: by mail-lf1-x132.google.com with SMTP id g7so9144032lfe.11 for ; Sun, 04 Sep 2022 01:19:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date; bh=ol7Y5ddKN5huAdIim3PW28S6v16g+WQJ8UB01XpqlEg=; b=ntm9K1Vhq4hmjiJZAtweLEDqwRMd3wQuvZAFMhV63C2I1qGdEH6WcYcIfy5Ea/QzGH VGMQm8z1GLwuISroUapWwTEfMSjXgldyJbzPhBBCuFLfkoVANOFUzAkQjzw5w2JkwsNE ZQ5+Y/3itg1lzbA0j1Zo4huC9YF+37CtcQ/Lc7YPzz4xLt03W/4QnCi7NLLUcwto4eDA pUOlwRU6Ameoqp+X58IrjK5GIGytJGlB3MdrzN644Rs2fjkPSSlyUCVEnFf0iXT3phEG pZRbM8Bs5jzKA3GEzpiX5ekP8InRDtfLxLUw3pWq55D/szMsrAv3D3/AO8qM5DPigGuD PaWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date; bh=ol7Y5ddKN5huAdIim3PW28S6v16g+WQJ8UB01XpqlEg=; b=uQjR7LpaVCoi8Y1kq5pYyfkOH6EhxE8lcj5fSU1bY8CvlXEhnsFJy64M/qtCRsHrsN HLgHdZIMBRgzHm1Z6lEmwsBex6J88HsGrBqlcLy7+5EwJz5zfPNIK8iiWCkMKf8/KUhV x8sGfofTHpboTox87IK+E43hlavadhRLPe8PKOkuzqCilAa6+bMQScpZyhhXvFO6U8As KKtfzN1T1aGSlWbaLdOzoGQ1Grz5hdAlVKmFli0pC/HneXcv1OGhE5Rp2WcPXYjZtBXq QpwFqMAA7JYFX1dfPkvzGjVbKAUCrrsgb4vE+/Jk8yCPPtjtOgHVVduqhX6cYYUfFU88 Ki8w== X-Gm-Message-State: ACgBeo38aFT/xrrVUv4SDc7l3dFazMh8wPudU8kTHEQxzQNe2FMjzFH4 avN7L0Odt9sBUft+Vm4wAypdgyg60Mx8Fd/wJygcvNgNCOw= X-Google-Smtp-Source: AA6agR58E4NJavEZnBsqwfWh4PLngiryuNGZx4uy+2syWK3y0h9FkqStQtdOJAXBU2Y0r+S7/OCrcZcmlBq2VZrNmNc= X-Received: by 2002:a05:6512:3b87:b0:494:9a8d:f74f with SMTP id g7-20020a0565123b8700b004949a8df74fmr5103183lfv.8.1662279565413; Sun, 04 Sep 2022 01:19:25 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=damien.mattei@gmail.com; helo=mail-lf1-x132.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:18561 Archived-At: my previous question ,clearly more, is : (define-syntax for/bc (syntax-rules (continue break) ((_ (init test incrmt) b1 ...) (call/cc (lambda (break) (let () init (let loop () (when test (call/cc (lambda (continue) b1 ...)) incrmt (loop))))))))) is there a way to make working this macro in a R6RS compatible way (i know it is possible in Racket or with syntax features...) to avoid error: (for/bc ({i <+ 0} {i < 5} {i <- {i + 1}}) {x <+ 7} (display x) (newline) (break)) ;;; :2:73: warning: possibly wrong number of arguments to `break' 7 ice-9/boot-9.scm:1685:16: In procedure raise-exception: Wrong number of arguments to # Entering a new prompt. Type `,bt' for a backtrace or `,q' to continue. Damien