From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtpout02-ext4.partage.renater.fr (smtpout02-ext4.partage.renater.fr [194.254.241.31]) by sourceware.org (Postfix) with ESMTPS id 80D883858432 for ; Mon, 13 May 2024 20:36:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 80D883858432 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=oca.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oca.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 80D883858432 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=194.254.241.31 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715632594; cv=none; b=LiY9TGgEC8RjCGJj960owqVir5Ia7r2gVV2HHV7gXCJeRFTxa15HTiQFarRhPl9WFtotZH1pz/bpIqxT2AyVZvQMLPR7e8f5YXdoPW4uEzMoZXV/MWUGao6TGylS7nmxGPczGQRJosV/eb6e1jeDyB6jlbL74oAyMXChXE9P2vU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715632594; c=relaxed/simple; bh=Mkx9sjP4AeCw+q9xqg7YwsXMZ7XGuB5syCyCrZxakok=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=maPNCyiFkpFhO5THD0FEEKCj7QxntFnwp73cAJafFm4BhOiiqJMkOmUMd7hmKy4ZuWLIwUEB17epP6tGsyX+8U49p6YO4KTCPwBwB0e2LIe8rzeS86BpI7/LIU5jILsW+2wytaqv9RcYppfI2ZkG/vxI7Kov+NP9lQEkL+SYSZE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from zmtaauth02.partage.renater.fr (zmtaauth02.partage.renater.fr [194.254.241.25]) by smtpout20.partage.renater.fr (Postfix) with ESMTP id 76C91C0476; Mon, 13 May 2024 22:36:29 +0200 (CEST) Received: from zmtaauth02.partage.renater.fr (localhost [127.0.0.1]) by zmtaauth02.partage.renater.fr (Postfix) with ESMTPS id 6F254A072C; Mon, 13 May 2024 22:36:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zmtaauth02.partage.renater.fr (Postfix) with ESMTP id 5F74DA0759; Mon, 13 May 2024 22:36:29 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zmtaauth02.partage.renater.fr 5F74DA0759 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oca.eu; s=51688159-7048-4452-88B4-FE5A10886D87; t=1715632589; bh=Mkx9sjP4AeCw+q9xqg7YwsXMZ7XGuB5syCyCrZxakok=; h=Message-ID:Date:MIME-Version:To:From; b=eRaegDp/Y2MVpEi3tv8lTyjbf1YRuWdkkCEX3GlgytmODfzoHfKlol3b2A3LVAH/H W7RGkuJotE/oQqKfir2rB2Dmg+jrGhXRi+73cKZc3/0sHvsJb0xpNJNlM3lIGDKxCB Yg+MAOaX0oZGONXNQNpT2nu+rFh4YQSzjJlZYC/y2HBVBJOftXV3oWMVE5HARvafgu c6JVG+PsGCUl+N94Z3WeLscTr32qu3GY38AbFSrjTgp+jbSUSFbB0nl7l7y8Bp1n66 zYPNzQ/qxqztOdBPCd/x1t3lBOF/ID/prdciXiFn46d0UPMHrvldcy21EsoFcAuA3M Mhhq89xJF0OdA== Received: from zmtaauth02.partage.renater.fr ([127.0.0.1]) by localhost (zmtaauth02.partage.renater.fr [127.0.0.1]) (amavis, port 10026) with ESMTP id rVisWO59EyZQ; Mon, 13 May 2024 22:36:29 +0200 (CEST) Received: from [192.168.1.12] (unknown [194.254.241.249]) by zmtaauth02.partage.renater.fr (Postfix) with ESMTPA id 13BCDA072C; Mon, 13 May 2024 22:36:29 +0200 (CEST) Message-ID: Date: Mon, 13 May 2024 22:36:28 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: Damien.MATTEI@univ-cotedazur.fr Subject: Re: syntax? in kawa/scheme To: Per Bothner , kawa References: <36548656-ba14-441d-8467-1e08f6e83194@oca.eu> Content-Language: fr From: Damien Mattei In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed X-Virus-Scanned: clamav-milter 0.103.8 at clamav02 X-Virus-Status: Clean X-Renater-Ptge-SpamState: clean X-Renater-Ptge-SpamScore: 0 X-Renater-Ptge-SpamCause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeggedgudeglecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucftgffptefvgfftnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfrhfuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffrghmihgvnhcuofgrthhtvghiuceouggrmhhivghnrdhmrghtthgvihesohgtrgdrvghuqeenucggtffrrghtthgvrhhnpeehhefgfffgtdfgjeefffeitdekvdfggfevhfdtuedtgedvueeiudejfefhkeduveenucfkphepudelgedrvdehgedrvdeguddrvdegleenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduleegrddvheegrddvgedurddvgeelpdhhvghloheplgduledvrdduieekrddurdduvdgnpdhmrghilhhfrhhomhepuggrmhhivghnrdhmrghtthgvihesohgtrgdrvghupdhnsggprhgtphhtthhopedvpdhrtghpthhtohepphgvrhessghothhhnhgvrhdrtghomhdprhgtphhtthhopehkrgifrgesshhouhhrtggvfigrrhgvrdhorhhg Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=BAYES_00,BODY_8BITS,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: yes in kawa there is no difference in this example: (equal? #'(1 2 3) '(1 2 3)) #t i had written for scheme (guile) a predicate based on the parsing of=20 display of an object but it will not work with kawa: (define (syntax? obj) =C2=A0 (cond ; a syntax object is: =C2=A0=C2=A0 ((pair? obj) ; a pair of syntax objects, =C2=A0=C2=A0=C2=A0 (and (syntax? (car obj)) =C2=A0=C2=A0 =C2=A0 (syntax? (cdr obj)))) =C2=A0=C2=A0 ((list? obj) =C2=A0=C2=A0 =C2=A0 (every syntax? obj)) =C2=A0=C2=A0 ((vector? obj) ; a vector of syntax objects =C2=A0=C2=A0=C2=A0 (every syntax? (vector->list obj))) =C2=A0=C2=A0 ((string? obj) ; as i will use the string representation of= object =C2=A0=C2=A0=C2=A0 #f) =C2=A0=C2=A0 ;; parse the representation of object to search for # =C2=A0=C2=A0 (else (let* ((str-obj (format #f "~s" obj)) =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (lgt-str-obj (string-length str-ob= j)) =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (str-syntax "# lgt-str-obj lgt-str-syntax) ; fi= rst, length greater =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 (string=3D? (substring str-obj 0 l= gt-str-syntax) =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 str-synt= ax) ; begin by "# (string-ref str-obj = (- lgt-str-obj 1)))))))) ; last=20 char is > but in fact my problem is to test equality for 2 syntax object and i can=20 not use equal? : #|kawa:34|# (equal? #'* #'*) #f but bound-identifier=3D? #|kawa:35|# (bound-identifier=3D?=C2=A0 #'* #'*) #t #|kawa:36|# (bound-identifier=3D?=C2=A0 #'* #'-) #f my problem is to test equality for operators in a syntax parser but this does not works for every syntax object: #|kawa:38|# (bound-identifier=3D? #'(1 2 3) #'(1 2 3)) java.lang.RuntimeException: bound-identifier-? - argument is not an=20 identifier =C2=A0=C2=A0 =C2=A0at kawa.standard.syntax_error.error(syntax_error.java= :55) =C2=A0=C2=A0 =C2=A0at kawa.lib.prim_imports.reportSyntaxError(prim_impor= ts.scm:249) =C2=A0=C2=A0 =C2=A0at kawa.lib.std_syntax.isBoundIdentifier$Eq(std_synta= x.scm:312) =C2=A0=C2=A0 =C2=A0at atInteractiveLevel-37.run(tty:38) =C2=A0=C2=A0 =C2=A0at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:290) =C2=A0=C2=A0 =C2=A0at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211) =C2=A0=C2=A0 =C2=A0at kawa.Shell.run(Shell.java:289) =C2=A0=C2=A0 =C2=A0at kawa.Shell.run(Shell.java:196) =C2=A0=C2=A0 =C2=A0at kawa.Shell.run(Shell.java:183) =C2=A0=C2=A0 =C2=A0at kawa.repl.processArgs(repl.java:724) =C2=A0=C2=A0 =C2=A0at kawa.repl.main(repl.java:830) so i must check a difference between the syntax object that have in=20 their string representation # and others Le 13/05/2024 =C3=A0 16:59, Per Bothner a =C3=A9crit=C2=A0: > Ce message provient d=E2=80=99un exp=C3=A9diteur externe =C3=A0 l=E2=80= =99universit=C3=A9 (adresse :=20 > per@bothner.com). Ne cliquez pas sur les liens et n=E2=80=99ouvrez pas = les=20 > pi=C3=A8ces jointes si vous ne connaissez pas l=E2=80=99exp=C3=A9diteur= ou que vous=20 > n=E2=80=99=C3=AAtes pas s=C3=BBr du contenu. En cas de doute, merci de = transf=C3=A9rer le=20 > mail =C3=A0 abuse@univ-cotedazur.fr > > > On 5/13/24 5:20 AM, Damien Mattei wrote: >> hello, >> >> any idea for a predicate for syntax object in Kawa/scheme like exist=20 >> in Racket 'syntax?' ? > > One problem is that everything is a syntax object. > > You can check if an object implements kawa.lang.SyntaxForm, but other=20 > objects are > also allowed in syntax values, if they don't need an explicit=20 > TemplateScope.