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 E1A943858C60 for ; Tue, 14 May 2024 07:59:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E1A943858C60 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 E1A943858C60 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=1715673583; cv=none; b=dRLYJpG7692ss6Ac0IonBX+ChstEzScA3qmsZj6AISMd61AuCbBbXZd4ZGrifiP0HKmhWq+JeFzYQFDI+ajmzD7LQfxBiR9VELezs9vKyQIjXid8rV0Q+h9ATp2mWLQxXJpi6xmqbcJB2y123j7meVHTCAsQQeiH6Kxn14GL1pE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1715673583; c=relaxed/simple; bh=6JBgw482Gl5XlLMX2DTHVNatjK0QqGOVkeQixRLhyfY=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=TaF+JgN82G8jTUpP42Nx4htwSAK+WqMPmNFZdv93pgr00jbyHkISKCbJ5g+w/wJDgeAtO+sqeAhp/FGTR59bYQI26JTaBVNwI8kcSwi2SnVFB/qNm4oFJDuGoFAcX+z9QdukMSBjrD6I0RuMUcq1SNqGUVncvdufriuTBxxQQ8s= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from zmtaauth04.partage.renater.fr (zmtaauth04.partage.renater.fr [194.254.241.26]) by smtpout20.partage.renater.fr (Postfix) with ESMTP id 9D21DBFCC3 for ; Tue, 14 May 2024 09:59:38 +0200 (CEST) Received: from zmtaauth04.partage.renater.fr (localhost [127.0.0.1]) by zmtaauth04.partage.renater.fr (Postfix) with ESMTPS id 07CE71C06DA for ; Tue, 14 May 2024 09:59:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zmtaauth04.partage.renater.fr (Postfix) with ESMTP id EB0F71C06DC for ; Tue, 14 May 2024 09:59:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zmtaauth04.partage.renater.fr EB0F71C06DC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oca.eu; s=51688159-7048-4452-88B4-FE5A10886D87; t=1715673577; bh=6JBgw482Gl5XlLMX2DTHVNatjK0QqGOVkeQixRLhyfY=; h=Message-ID:Date:MIME-Version:To:From; b=sGOxBhbdoWdttOqwG1Rs59hIyWJCsKrkiXjxF55dQq1tUyBiARt4jCctP/ukt+Sdg 7i68zmT6stBd7f+8t6v+JNhaCCPFnuc3wo/YNu9MniIcvz+/B9Dvl05m+IfmCHRyT2 Grpc+1oPF95waSSTVt3oeZ9obAUOkhiKtpfI8Ythxh6NyNl1vPnOVR5bgCA1PCVqUY EyHkJ/A9Y5GhkHmqpyPbor1syGSq04ZLu2JjO8rnewHoqbH6Yav80GTfL+aKFINNDp gY4tdLWMaaXIeqMA+kbnF+5sXp9XkqSTS4u4jtUmnsTGSTbC0C/EwAOd0GJGbzwjgP MZoDeage6Oraw== Received: from zmtaauth04.partage.renater.fr ([127.0.0.1]) by localhost (zmtaauth04.partage.renater.fr [127.0.0.1]) (amavis, port 10026) with ESMTP id UHSw0t1IZ3x3 for ; Tue, 14 May 2024 09:59:37 +0200 (CEST) Received: from [192.168.1.12] (unknown [194.254.241.250]) by zmtaauth04.partage.renater.fr (Postfix) with ESMTPA id A03591C06DA for ; Tue, 14 May 2024 09:59:37 +0200 (CEST) Message-ID: <1606b6e6-89e6-450e-af41-de4e345fd388@oca.eu> Date: Tue, 14 May 2024 09:59:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Reply-To: Damien.MATTEI@univ-cotedazur.fr Subject: Re: syntax? in kawa/scheme To: kawa@sourceware.org References: <36548656-ba14-441d-8467-1e08f6e83194@oca.eu> <217f6a16-554d-4723-b792-d1ff16893b15@bothner.com> 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 clamav01 X-Virus-Status: Clean X-Renater-Ptge-SpamState: clean X-Renater-Ptge-SpamScore: 0 X-Renater-Ptge-SpamCause: gggruggvucftvghtrhhoucdtuddrgedvledrvdeghedguddukecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucftgffptefvgfftnecuuegrihhlohhuthemuceftddtnecunecujfgurhepkfffgggfrhfuvfhfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpeffrghmihgvnhcuofgrthhtvghiuceouggrmhhivghnrdhmrghtthgvihesohgtrgdrvghuqeenucggtffrrghtthgvrhhnpeehhefgfffgtdfgjeefffeitdekvdfggfevhfdtuedtgedvueeiudejfefhkeduveenucfkphepudelgedrvdehgedrvdeguddrvdehtdenuceurggutfgvphhuthfgmhgrihhlpegrsghushgvsehunhhivhdqtghothgvuggriihurhdrfhhrnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehinhgvthepudelgedrvdehgedrvdeguddrvdehtddphhgvlhhopegludelvddrudeikedruddruddvngdpmhgrihhlfhhrohhmpegurghmihgvnhdrmhgrthhtvghisehotggrrdgvuhdpnhgspghrtghpthhtohepuddprhgtphhtthhopehkrgifrgesshhouhhrtggvfigrrhgvrdhorhhg Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.1 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: i can do a minimal syntax check like this for operator (works also for=20 procedures): ;; parse the representation of object to search for # (define (syntax-check? obj) =C2=A0 (let* ((str-obj (format #f "~s" obj)) =C2=A0=C2=A0 =C2=A0 (lgt-str-obj (string-length str-obj)) =C2=A0=C2=A0 =C2=A0 (str-syntax "# lgt-str-obj lgt-str-syntax) ; first, length g= reater =C2=A0=C2=A0 =C2=A0 (string=3D? (substring str-obj 0 lgt-str-syntax) =C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0 str-syntax) ; begin b= y "# (string-ref str-obj (- lgt-str-obj 1))= )))) ; last char=20 is > #|kawa:57|# (syntax-check? #'cons) #t #|kawa:58|# (syntax-check? #'*) #t #|kawa:59|# (syntax-check? *) #f Le 14/05/2024 =C3=A0 09:48, Damien Mattei 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 > kawa-bounces+damien.mattei=3Dunice.fr@sourceware.org). Ne cliquez pas=20 > sur les liens et n=E2=80=99ouvrez pas les pi=C3=A8ces jointes si vous n= e connaissez=20 > pas l=E2=80=99exp=C3=A9diteur ou que vous n=E2=80=99=C3=AAtes pas s=C3=BB= r du contenu. En cas de=20 > doute, merci de transf=C3=A9rer le mail =C3=A0 abuse@univ-cotedazur.fr > > but in fact testing the string representation is enought for me as i=20 > need only to test for operators such as #'* #'+.... > > indeed only Racket has a good syntax? procedure: > > Welcome to DrRacket, version 8.12 [cs]. > Language: racket, with debugging; memory limit: 8192 MB. > > > (syntax? #'(2 * 3)) > #t > > someone answered me about syntax? for Guile being in (system syntax)=20 > but it works well only on atomic expression: > > scheme@(guile-user)> (use-modules (system syntax)) > scheme@(guile-user)> syntax? > $1 =3D # > scheme@(guile-user)> (syntax? #'(2 * 3)) > $2 =3D #f > > > this is not the good result (above) > > as: > > scheme@(guile-user)> #'(2 * 3) > $3 =3D (# #=20 > #) > scheme@(guile-user)> (syntax? #'*) > $4 =3D #t > > scheme@(guile-user)> (syntax? *) > $6 =3D #f > > > but if someone explain me how to=C2=A0 'check if an object implements=20 > kawa.lang.SyntaxForm' i can do that? > > perheaps with an exception.... > > > Damien > > Le 14/05/2024 =C3=A0 00:20, Damien Mattei 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 >> kawa-bounces+damien.mattei=3Dunice.fr@sourceware.org). Ne cliquez pas=20 >> sur les liens et n=E2=80=99ouvrez pas les pi=C3=A8ces jointes si vous = ne=20 >> connaissez pas l=E2=80=99exp=C3=A9diteur ou que vous n=E2=80=99=C3=AAt= es pas s=C3=BBr du contenu. En=20 >> cas de doute, merci de transf=C3=A9rer le mail =C3=A0 abuse@univ-coted= azur.fr >> >> i modify a SRFI 105=C2=A0 curly infix parser to move some function tow= ards=20 >> macro, then to pre-parse the code on the fly at the pre-compil stage=20 >> of the macro,then use the pre-parsed code in the expansion phase.=20 >> Finally the run-time execution of the generated code will be faster=20 >> as no parsing will be done at this run-time phase. (exmple : a=20 >> mathematic formula is known and will not change at run-time ,the=20 >> infix to prefix operator precedence algorithm can be applied before=20 >> runtime) . Prior i parsed s-expr now it will be syntax expression,=20 >> the logic is the same but the code will change, instead of procedure=20 >> or quoted procedures or form it will be syntax objects. For the=20 >> operator precedence i need to be able to compare equality of some=20 >> operator in a syntaxic form (like #'*, #'+ etc...) I admit as there=20 >> is no native curly-infix srfi 105 in kawa it is already done by a=20 >> parser in command line. (this more easy in Guile but very few scheme=20 >> implement SRFI 105 anyway so i will reuse this code in the future) >> >> Le 13/05/2024 =C3=A0 23:47, 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=A9dite= ur ou que vous=20 >>> n=E2=80=99=C3=AAtes pas s=C3=BBr du contenu. En cas de doute, merci d= e transf=C3=A9rer le=20 >>> mail =C3=A0 abuse@univ-cotedazur.fr >>> >>> >>> On 5/13/24 1:36 PM, Damien Mattei wrote: >>>> but in fact my problem is to test equality for 2 syntax object and=20 >>>> i can not use equal? : >>> >>> Why? What are you actually trying to do?