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:30:40 +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="23328"; 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:32:42 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 1oXerx-0005tq-DY for guile-user@m.gmane-mx.org; Mon, 12 Sep 2022 10:32:41 +0200 Original-Received: from localhost ([::1]:57650 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oXerw-0006mU-8F for guile-user@m.gmane-mx.org; Mon, 12 Sep 2022 04:32:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40704) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oXeqM-0006lo-RJ; Mon, 12 Sep 2022 04:31:02 -0400 Original-Received: from mail-lf1-x12c.google.com ([2a00:1450:4864:20::12c]:35472) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oXeqE-0007k8-GY; Mon, 12 Sep 2022 04:31:02 -0400 Original-Received: by mail-lf1-x12c.google.com with SMTP id z25so13631738lfr.2; Mon, 12 Sep 2022 01:30:53 -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=UTL0YizGrY8aON5vI+pyoXU3CbfmCGBqiaEmol7YDCo=; b=kjauAsvt41anBD9OucZOxZOCNNOvca3Eu3V3YQCMV8IJX5NauIQEsqFR9Zp0xFZc7r 8lf6sb5FZ/UXhXTFX1sTDRy2rgbdlqtMhi9Q7YYEJmfX6ZVZYcha+/RGBk6POmNxxSB/ q442REsXiULQUmSE2GY70y+N3XiH8y3LVProBkX6IGLPL6zmfs7rhapuhzi9xdQLuTXg kzhVS84u01x+L6aVg7AyX/pjvoePiZExLxs0rqxgsjLWEHEoyu1j8wSMUqlxFvZ2iO54 knF2xDZW0s25NqkHDJSvMMGcSAtRquQF++zm93gLBhC2F+EnNxBWJMu4W3zRMEd3jg24 TcmQ== 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=UTL0YizGrY8aON5vI+pyoXU3CbfmCGBqiaEmol7YDCo=; b=q33F/wbeAfCLee1/1lAIw6TFfw0uWYx3vN9B78zHvuuibsApJXJR+No+3UZgd8nkS1 DszmTgBzqmCISM6IXvUcEis0Nfk0Htq+cxy5JSYLd88gRA8pVOJGQHwFnY2A4mDoe23W Mtnr8z5IaYz5DxWb3KOMMLDWFTmOG9RAWwch4U2U86SFmsFbQcXoW5OKWZ4Yn45agcyN 5X50R/IeFOMOdsGr07ZE7NkP+McJkocol8qMoMf9a9JoD/+RjT3qYMTqmTs4QAsh8UTm pknq1ZycwxPF7j/cDJXzWf6YaKY7ZIIi3WvGy8bfCRmSxuFZdIkn7o1izH2JcXqHBpLv 8z/w== X-Gm-Message-State: ACgBeo1+WVVU49nE0RotZApuG+GFS+xrFawIkqkqVmmdTLYLor0OapPR jghpZoV3I5DH8ixuqr1gm+3XhkUEqJWU1RbM7/hJLj24mPU= X-Google-Smtp-Source: AA6agR47thC4eWFihm3ZgECtmx3DhWf7BSPOfVY+HrlawQfGCzxQacJI6L5IgV18UZrRQM3z3T5c2u5lMBNdzPOQJtM= X-Received: by 2002:a05:6512:3c8c:b0:498:f7ba:9a69 with SMTP id h12-20020a0565123c8c00b00498f7ba9a69mr5413751lfv.8.1662971452027; Mon, 12 Sep 2022 01:30:52 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::12c; envelope-from=damien.mattei@gmail.com; helo=mail-lf1-x12c.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:18582 gmane.lisp.guile.devel:21346 Archived-At: just forget to add , if it is unclear it is 'case of scheme: https://www.gnu.org/software/guile/docs/docs-1.8/guile-ref/if-cond-case.html#if-cond-case On Mon, Sep 12, 2022 at 10:27 AM Damien Mattei wrote: > 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 >> >>