From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jean Abou Samra Newsgroups: gmane.lisp.guile.user Subject: Re: Inconsistencies with free-identifier=? and bound-identifier=? Date: Fri, 21 Jul 2023 11:08:14 +0200 Message-ID: References: <008f724d79b871ce1d68121402bbcbcdd25ec270.camel@abou-samra.fr> Mime-Version: 1.0 Content-Type: multipart/signed; micalg="pgp-sha512"; protocol="application/pgp-signature"; boundary="=-u42toZ/qbdy+1cCvF/qS" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="15346"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Fri Jul 21 11:09:10 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 1qMm8L-0003s9-FF for guile-user@m.gmane-mx.org; Fri, 21 Jul 2023 11:09:09 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qMm7a-0001rn-19; Fri, 21 Jul 2023 05:08:22 -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 1qMm7Y-0001rb-Q1 for guile-user@gnu.org; Fri, 21 Jul 2023 05:08:20 -0400 Original-Received: from mout.kundenserver.de ([217.72.192.74]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qMm7W-0006Jw-Jk for guile-user@gnu.org; Fri, 21 Jul 2023 05:08:20 -0400 Original-Received: from [192.168.1.33] ([82.65.251.18]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.184]) with ESMTPSA (Nemesis) id 1MuUWi-1q4h4U1Yoc-00rc27 for ; Fri, 21 Jul 2023 11:08:16 +0200 In-Reply-To: <008f724d79b871ce1d68121402bbcbcdd25ec270.camel@abou-samra.fr> X-Provags-ID: V03:K1:DAerY0nm3sDaJinNGIJGnUk8eLpmBSLX2SggW0tjtUwaD3dUuKJ pMRPdcuQPWJ9xe14IdokPwLyyCs6rgYnaDPzoG4egElEfJskKX1sO1PabxiGz2ZOxx3WT21 tEI8s8Xz7Q3mcOfPxa+V7eBS5MoGqD5wUtb1I77bSMtovOBbl8vB6WZxWtbV1QtFMfeCcf1 fJwx12/cxZijjmoDJQINA== UI-OutboundReport: notjunk:1;M01:P0:lHYr5e9QzXU=;y05F98sor4wW+rhgqF/rky4/T99 emwSXN7ntwJ3pVfU5ZOt9iF4sg2CH1hdRsN0tw1xSRMWhB8VP9mOkXrMWW4SmkCQoFre1SsR6 9E4FophrdnZL5Yb5qoZ/pcJAlXt8vWOWkmfXqLL+cVlIrbzu2j8J2RvNCWT5Wq5xVNdg6aP4Z PhfNsZPUiZGrRVFM9xypUR4A0CyoH4qTv7MgJeoRpLGbMydeBGqh0CUPs2eBhKqkuHXa4iibC MWe8UOZydQ/SGdbIn3JvMITYp95MGBNRT0f2UITIHOmCKrpiUmmSoXQQNd7/n1/xswpdCUDGo aXuRd4NmYalUkAOYHSnNysGMfNSlstkOWYx8cN2SnjlYcBs+VqfDPOkeJoY6/Rm3mMsDv3P7e JFc31BjJydu1+0FykB8ab6abZ2fYvVIab4jLiMH4S6nQnlonQpHXPkmGsBJ4d5sgU04D7qHZz J/wCzbNKQWDOvEU8b7PfppMEGUXw/PGjHa9dAagPXap67/X66jyb2wQSSfeQF+AqxI2ubX4rP PVaglV7NYqgRiBFK61B1JUMGqVy2x9Vv3sQKViz2rn5/nLt9BC75PeKA/D+NcrXRQf6wsTaZw ysjCq79bZr+LrhdL+bRqZwcUAdfbHLyJbNXrSoM8B5Kg2ymlpKj/ovZwseJ8l64p0gFT6aFDJ 5FbLCD2fKweFwZL/CqIFGMHnzP+kqXaGClYD+qNqiA== Received-SPF: pass client-ip=217.72.192.74; envelope-from=jean@abou-samra.fr; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-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:19103 Archived-At: --=-u42toZ/qbdy+1cCvF/qS Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Relatedly,=C2=A0R6RS is clear that an identifier matches a literal in a syntax-case clause iff they're free-identifier=3D?, but as far as I can see, it does not clarify how the literals themselves in the syntax-case clause are recognized, namely what predicate is used to match them against the literals list of the syntax-case expression. Test program: (define-syntax build-syntax (syntax-rules () ((_ expr expr* ...) (let-syntax ((temp-macro (lambda (ignored-syntax) expr expr* ...))) (temp-macro))))) (build-syntax (with-syntax ((foo1 (let ((foo 'foo)) #'foo)) (foo2 (let ((foo 'foo)) #'foo))) (with-syntax ((foo1-foo2-free=3D? (free-identifier=3D? #'foo1 #'foo2)) (foo1-foo2-bound=3D? (bound-identifier=3D? #'foo1 #'foo2))= ) (syntax (begin (display "free-identifier=3D? ") (display foo1-foo2-free=3D?) (newline) (display "bound-identifier=3D? ") (display foo1-foo2-bound=3D?) (newline) (syntax-case #'not-foo (foo1) (foo2 (display "Matched as literal\n")) (_ (display "Not matched\n")))))))) Guile 3.0: free-identifier=3D? #f bound-identifier=3D? #t Matched as literal Racket: free-identifier=3D? #t bound-identifier=3D? #t Not matched As you can see, foo1 and foo2 are *more* equal in Racket (also free-identif= ier=3D? in addition to being bound-identifier=3D?), yet they don't match in Racket = whereas they do in Guile. Chez Scheme gives the same identifier predicate results as Guile, but it doesn't consider them matched: free-identifier=3D? #f bound-identifier=3D? #t Not matched Kawa somehow doesn't even handle the program: free-identifier=3D? #t bound-identifier=3D? #t java.lang.NullPointerException: Cannot invoke "kawa.lang.Translator.getCurrentSyntax()" because "tr" is null at kawa.lang.SyntaxPattern.match(SyntaxPattern.java:604) at kawa.lang.SyntaxPattern.match(SyntaxPattern.java:88) at tmp2.run(tmp2.scm:6) at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290) at gnu.expr.CompiledModule.evalModule(CompiledModule.java:42) at gnu.expr.CompiledModule.evalModule(CompiledModule.java:60) at kawa.Shell.runFile(Shell.java:571) at kawa.Shell.runFileOrClass(Shell.java:474) at kawa.repl.processArgs(repl.java:710) at kawa.repl.main(repl.java:830) free-identifier=3D? #f bound-identifier=3D? #t Not matched --=-u42toZ/qbdy+1cCvF/qS Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQSZ7TKxnKGyBvBjzBmj8PYLiTOX/gUCZLpK/gAKCRCj8PYLiTOX /uslAQDZDUycQ3TMDuz/M7LnfsFzjD1T2pKX/GMHci9t+2HzCAD+NE3EVKWH7214 cmUfb8tNUr/1XeInzwt40UTIoEzIKQ8= =jh7c -----END PGP SIGNATURE----- --=-u42toZ/qbdy+1cCvF/qS--