From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp4-g21.free.fr (smtp4-g21.free.fr [IPv6:2a01:e0c:1:1599::13]) by sourceware.org (Postfix) with ESMTPS id 63AF73858408 for ; Mon, 27 Sep 2021 05:05:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 63AF73858408 Received: from smtpclient.apple (unknown [IPv6:2a01:e34:ec46:c6d0:10c9:7c78:83ac:fa7b]) (Authenticated sender: phiroc@free.fr) by smtp4-g21.free.fr (Postfix) with ESMTPSA id 6A05C19F4F3; Mon, 27 Sep 2021 07:05:44 +0200 (CEST) From: Philippe de Rochambeau Mime-Version: 1.0 (1.0) Subject: Re: Recursive define-syntax Date: Mon, 27 Sep 2021 07:05:44 +0200 Message-Id: <427B2D33-86D0-471D-9CDB-88F2877BE5F8@free.fr> References: Cc: kawa@sourceware.org In-Reply-To: To: Per Bothner X-Mailer: iPad Mail (19A346) X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, JMQ_SPF_NEUTRAL, MIME_QP_LONG_LINE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Sep 2021 05:05:53 -0000 Hi Per, Thank you for your feedback. The code works on LispKit (cf. https://github.com/objecthub/swift-lispkit) w= hich is based on R7RS. But if it doesn=E2=80=99t work in Kawa, it doesn=E2=80= =99t really matter. #| Pamphlet, p. 52 |# (import (lispkit match)) (import (srfi 48)) (define (dim m) (match m ((first . rest) `(,(length m) . ,(dim first))) (_ '()))) Cheers, Philippe > Le 26 sept. 2021 =C3=A0 23:04, Per Bothner a =C3=A9crit := >=20 > =EF=BB=BF >=20 >> On 9/26/21 05:08, Philippe de Rochambeau via Kawa wrote: >> Hello, >> the following procedure, excerpted from =C2=AB A Pamphlet Against R =C2=BB= >> (define (dim m) >> (match m >> ((first . rest) >> `(,(length m) . ,(dim first))) >> (_ >> '()))) >> =E2=80=A6 causes Kawa to display the following error message: >> /dev/tty:6:5: unrecognized pattern operator first >=20 > There is no standard Scheme 'match' syntax - there are a > number of different and incompatible extensions. =C2=AB A Pamphlet Agains= t R =C2=BB > uses the Guile language, which is quite different frm Kawa. >=20 > Specifically, the Kawa "pattern" syntax is quite limited - it > is mainly a proof of concept - a test of the basic framework. >=20 > Thar said, this seems to work: >=20 > (define (dim m) > (match m > ([first rest ...] > `(,(length m) . ,(dim first))) > (_ > '()))) >=20 > (dim m0) =3D> (3 4) >=20 >> Are recursive =C2=AB syntaxes =C2=BB not possible in Kawa? >=20 > Before you ask that question, you should try some code that > works on at least one other (preferable two) Scheme implementations. > If you have example code that works on other Scheme implementation(s) > and does not depend on an implementation-specific extension, but > not on Kawa - then we can discuss whether there is a Kawa bug or limitatio= n. > --=20 > --Per Bothner > per@bothner.com http://per.bothner.com/