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,gmane.lisp.guile.devel Subject: Re: case source code Date: Mon, 12 Sep 2022 10:27:23 +0200 Message-ID: References: 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="2002"; mail-complaints-to="usenet@ciao.gmane.io" Cc: guile-user , guile-devel To: Zelphir Kaltstahl Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Mon Sep 12 10:28:16 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 1oXenf-0000Cm-Jj for guile-user@m.gmane-mx.org; Mon, 12 Sep 2022 10:28:15 +0200 Original-Received: from localhost ([::1]:51282 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXene-0005bd-6o for guile-user@m.gmane-mx.org; Mon, 12 Sep 2022 04:28:14 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55972) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXen6-0005bR-4D; Mon, 12 Sep 2022 04:27:40 -0400 Original-Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]:36641) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXen3-0006xL-6D; Mon, 12 Sep 2022 04:27:39 -0400 Original-Received: by mail-lf1-x129.google.com with SMTP id f9so12861002lfr.3; Mon, 12 Sep 2022 01:27:36 -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=tXXTHGQZ47ei4bvYH3HpLOfGi7i1UL0lF5yUxBR7dNY=; b=GdXfb1gbqNAM7ia63Fwow0EF6yYCcRnPnWcoN80v9NjVivGdzn86vPsBdkCJxGyawK ZD6JmdSyFR0xWtzxAnDnYhZCJQk9q1QMubPNvkFAPfCSxR2irZ1ndj9+8Lch5HNLUOrP 9Du2glbz+t4lW+Y965eggTKfXgchxgY7ZAR6NH69t+DAmHZGf+UNfpRpoxakab/86wrG CZvsuU0n95AWH1Vpfp3aB+XwjWBlSsWNF9FaIYCE8OR8nelmfNdR18A84Z+If2F9JTv9 66+bK5Dw3GH47V54SbqQ8KP2P2Sqs7KzZBAzfs91xOOItxgbMW/Usp1FtWdxYYZ+6siD Eg1g== 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=tXXTHGQZ47ei4bvYH3HpLOfGi7i1UL0lF5yUxBR7dNY=; b=PlbMcPgDDAP7/+CVhZqoGgYG3dn7eG4m+VWUSMlzswLMOrw2sAsDp4J6U13KIuzvGj G1TUAmEZxIMTv+M5xYW2sOUFgZOcLhqT5eX2iD+6jcCILftdcHrOOtf0JCWoqBVdG8Ga 2QFF4PYYty3TQaOUWJy++DRF/Sy5JzftvERhkDkm2BcJ0z5kcq73mafmoml/WF6HFSmi YVQbZFjGbqt+0+NR7FvIW4gL3XSXvU/Sp6NJl4KMBWibO4psS06d9uwdwo5QlW83KEhf UQiicbsi+hsXoLvxKJCqODyFKZGRpEK3NO1Dqvkes3a5qVcolSPAm4Ng7YOXyCvhl6kP w8PA== X-Gm-Message-State: ACgBeo3T2VfN3KFAdbzXleS4Oys1D9YItZ53Qg+xbPUb2MU5G0lpD0vi xQDO/QpD28tzojYT5nLaJlshvWo9RWUg4V40oFg= X-Google-Smtp-Source: AA6agR6XwK5lNC3EmEhw5KZ7Td5M2mYKijuGj2RSsP4DnNESkAYf5vzbRCBlAwOFf27I/S2s5BTDFYqxndqT4I7w3ww= X-Received: by 2002:a05:6512:1154:b0:48b:3020:b29 with SMTP id m20-20020a056512115400b0048b30200b29mr8127107lfg.338.1662971254668; Mon, 12 Sep 2022 01:27:34 -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:18581 gmane.lisp.guile.devel:21345 Archived-At: sorry if my question was unclear , i search the source code if it exist in scheme with macro (or not) but not in C for the 'case function (procedure or macro) , i want to modify the code to allow inner definitions the way i do it for example with 'do: ;; with a definition inside only the new version works: ;; (do ((i 1 (1+ i)) ;; (p 3 (* 3 p))) ;; ((> i 4) ;; p) ;; (define x 7) ;; (set! p (+ p i x))) ;; $3 = 1257 (define-syntax do (syntax-rules () ((do ((var init step ...) ...) (test expr ...) command ...) (letrec ((loop (lambda (var ...) (if test ;;(begin (let () #f ; avoid empty begin expr ...) ;;(begin (let () command ... (loop (do "step" var step ...) ...)))))) (loop init ...))) ((do "step" x) x) ((do "step" x y) y))) regards, Damien On Mon, Sep 12, 2022 at 9:46 AM Zelphir Kaltstahl < zelphirkaltstahl@posteo.de> wrote: > Hello Damien, > > On 9/12/22 09:42, Damien Mattei wrote: > > Hello, > > i can not find in the scheme community a definition of 'case in term of > > macro as for when, unless,while,do... does anyone have it? > > thanks, > > Damien > > Can you give an example of what form you mean? > > Regards, > Zelphir > > -- > repositories: https://notabug.org/ZelphirKaltstahl > >