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: 2 macros in one expression Date: Fri, 14 Apr 2023 13:02:56 +0200 Message-ID: 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="16231"; mail-complaints-to="usenet@ciao.gmane.io" To: guile-user Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Apr 14 13:04:24 2023 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 1pnHE7-00045T-Qy for guile-user@m.gmane-mx.org; Fri, 14 Apr 2023 13:04:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pnHDV-0002da-2C; Fri, 14 Apr 2023 07:03:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pnHDS-0002dM-La for guile-user@gnu.org; Fri, 14 Apr 2023 07:03:42 -0400 Original-Received: from mail-ed1-x529.google.com ([2a00:1450:4864:20::529]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pnHDG-00029V-Vr for guile-user@gnu.org; Fri, 14 Apr 2023 07:03:40 -0400 Original-Received: by mail-ed1-x529.google.com with SMTP id 4fb4d7f45d1cf-50508810c8bso1688790a12.3 for ; Fri, 14 Apr 2023 04:03:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681470187; x=1684062187; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=KuQevaDMKYxfPUHK+lHdbnaanu71NCIF6oxCSwMggEQ=; b=qqPFiSXaLDI1VY+KFjjlBv3LoqdQ48dnD7wts1scxuMHL1vFpfLtq1LR3nVkIMhWKL G5dsZOJpUhqPyoWkFJboETTqnHVHBlmLuIFbhby1O90QOKUSw7IL3N2GO47/8itUSqJM QTzMH/Y5SOY2lA3I0rgOiMId5GweQnvulLI1Q8O8ZRGkFPIGMVcVRlztculS8AlWwBGK riwCxV0LxCrKsjwPGXtPkadjInLWNJnFvmV3lE+mKvohX2honzWJxV8Zevgr1JPFY8kY ltFqtn6pgkDtDn7Ly/TynbHZDVM4oUvD4LzsoQgiGsaHdFFF9i1MyEtjwlY7d1jx+zui z8bA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681470187; x=1684062187; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=KuQevaDMKYxfPUHK+lHdbnaanu71NCIF6oxCSwMggEQ=; b=T2CZgAQ1om5tnUQ2vftYBnYDx0otnOnUc691w6F2KSyCawb3cDvt4dMwP07twtz3l+ Rb6A7r/ep34P5WLmt/K86dVS0MG4j55eiePD7VIO5PWTZBkKEl9ifItlxyb5kQjB8TLp gKd6KFb5VsTKsQZr0LoLxrfazlIkMiaXEVLsq4KORq26MondDQ+TExvJzH51LGJzNlrz KnTWi25KwLe0NosDah85QNOqz1prae+9Cue+oIwQkI5xppqJWTrRtCRPl2J4j6LvvAXn UzcAUXNPyLLQ1TEaOSVNEMtOq4Zpp5lshd/OxtISnS+oKOElPQSMuczzDN4OXi6pLNZP FHIg== X-Gm-Message-State: AAQBX9dTLRFVRDRn3XNxWLdIQYo/LtMDWDPTAaO0O3lMSb8zQgiEyFt8 aqQZN84rkDNyGOJ22oLgbUn1EmnRRxYOFsiNeVmjXE5Vt3s= X-Google-Smtp-Source: AKy350arKs0S8n550dU0GTklIgy7P6k9F+W60xphkONZhLuPUxIwdpViwJ+AQzWDDGxQnn8dIICZAjK1bX+qTwzfIn8= X-Received: by 2002:a50:baec:0:b0:4fa:d8aa:74ad with SMTP id x99-20020a50baec000000b004fad8aa74admr2866769ede.8.1681470187472; Fri, 14 Apr 2023 04:03:07 -0700 (PDT) Received-SPF: pass client-ip=2a00:1450:4864:20::529; envelope-from=damien.mattei@gmail.com; helo=mail-ed1-x529.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, T_SCC_BODY_TEXT_LINE=-0.01, T_SPF_TEMPERROR=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-bounces+guile-user=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.user:18958 Archived-At: hello, i have 2 macros used in one expression like this: scheme@(guile-user)> (define i 2) scheme@(guile-user)> {i <- i + 1} and i got this error: While compiling expression: Syntax error: unknown location: source expression failed to match any pattern in form <- i use SRFI-105 so : '{i <- i + 1} expand in: ($nfx$ i <- i + 1) and i'm expecting $nfx$ to be called but none of this happens: scheme@(guile-user)> ($nfx$ i <- i + 1) While compiling expression: Syntax error: unknown location: source expression failed to match any pattern in form <- it seems to be the <- macro and i do not understand why? any idea? macros are defined like this for the beginning: ;; from file assignment.scm (define-syntax <- (syntax-rules () ;; special form like : (<- ($bracket-apply$ T 3) ($bracket-apply$ T 4)= ) ;; one dimension array, example: {a[4] <- 7} ;; $bracket-apply$ is from SRFI 105 bracket-apply is an argument of the macro ((_ (bracket-apply container index) expr) .... ;; from file scheme-infix.scm (define-syntax $nfx$ (syntax-rules () ((_ ident opspecial term1 op term2) (cond ((or (equal? (quote opspecial) (quote <-)) (equal? (quote opspecial) (quote =E2=86=90))) (begin (display "$nfx$") (newline) (opspecial ident (op term1 term2)))) ;; {ident <- {term1 op term2}} ... it is in a module like this: (define-module (Scheme+) #:use-module (growable-vector) #:use-module (srfi srfi-69) ;; Basic hash tables #:use-module (srfi srfi-31) ;; rec #:export ($nfx$ def $bracket-apply$ <- =E2=86=90 -> =E2=86=92 <+ =E2=A5= =86 +> =E2=A5=85 declare $ & condx <> =E2=89=A0 ** =E2=87=9C =E2=87=9D repeat) #:replace (do when unless)) (include-from-path "def.scm") (include-from-path "array.scm") (include-from-path "set-values-plus.scm") (include-from-path "apply-square-brackets.scm") (include-from-path "assignment.scm") (include-from-path "declare.scm") (include-from-path "condx.scm") (include-from-path "block.scm") (include-from-path "not-equal.scm") (include-from-path "exponential.scm") (include-from-path "while-do-when-unless.scm") (include-from-path "repeat-until.scm") (include-from-path "scheme-infix.scm") if it can help. Regards, Damien