From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: adriano Newsgroups: gmane.lisp.guile.user Subject: Re: macro syntax-error works in prefix but not curly-infix Date: Sun, 19 Sep 2021 08:23:45 +0200 Message-ID: <9e413208bf72c04fa0d5ce3063a7d68285593173.camel@riseup.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29524"; 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 19 08:24:18 2021 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 1mRqFO-0007Pd-2v for guile-user@m.gmane-mx.org; Sun, 19 Sep 2021 08:24:18 +0200 Original-Received: from localhost ([::1]:33946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mRqFM-0004wR-7t for guile-user@m.gmane-mx.org; Sun, 19 Sep 2021 02:24:16 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36758) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRqEz-0004w4-Et for guile-user@gnu.org; Sun, 19 Sep 2021 02:23:53 -0400 Original-Received: from mx1.riseup.net ([198.252.153.129]:49248) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mRqEw-00057l-Pm for guile-user@gnu.org; Sun, 19 Sep 2021 02:23:53 -0400 Original-Received: from fews2.riseup.net (fews2-pn.riseup.net [10.0.1.84]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "fews2.riseup.net", Issuer "R3" (not verified)) by mx1.riseup.net (Postfix) with ESMTPS id 4HByLs53NgzDv4b; Sat, 18 Sep 2021 23:23:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=riseup.net; s=squak; t=1632032629; bh=Np8hIl37MvzMzER1bT9bmxDAGvyk1h4DvEG/swQqmn8=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=Cf0G47/lUph8j/Pg5iGnzo7ppqzo7caEaMe6Q94hQzddtU3lG8KTDTWeAB9GPUXQF m5aHCf6ia5oFVnzqJ5I86QrHZZPW4jXXCOi8nGz7+0/pbwkRni81A+GhcWF1EzdO3R I9WtTpOStByheZMJJP6syVso81ZH/1NuxTVXzNIY= X-Riseup-User-ID: 08680B075F8AD7F4229354F581EBDDF02AD79E004357206E804C3EC1014180FA Original-Received: from [127.0.0.1] (localhost [127.0.0.1]) by fews2.riseup.net (Postfix) with ESMTPSA id 4HByLr5nqMz1yVL; Sat, 18 Sep 2021 23:23:48 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=198.252.153.129; envelope-from=randomlooser@riseup.net; helo=mx1.riseup.net X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 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:17750 Archived-At: Il giorno sab, 04/09/2021 alle 16.41 +0200, Damien Mattei ha scritto: > hi, > > i have this macro: > > (define-syntax <+ >   (syntax-rules () >     ((_ var expr) (define var expr)) >     ((_ err ...) (syntax-error "Bad <- form")) ;; does not work in > infix ! >     )) > > why my syntax-error pattern never reach in infix: > > scheme@(guile-user)> {x <+ 7 8} > While compiling expression: > Syntax error: > unknown file:3:3: source expression failed to match any pattern in > form <+ > > but ok in prefix: > > scheme@(guile-user)> (<+ x 9 10) > While compiling expression: > Syntax error: > unknown location: <+: Bad <- form in form (<+ x 9 10) > > why? > Regards, > Damien As far as I understand, infix syntax can't be achieved through macros You'd need a custom reader for that I might be wrong, but at least I offered something