From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from aibo.runbox.com (aibo.runbox.com [91.220.196.211]) by sourceware.org (Postfix) with ESMTPS id 442EB3858C60 for ; Sun, 26 Sep 2021 21:04:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 442EB3858C60 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=bothner.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=bothner.com Received: from [10.9.9.73] (helo=submission02.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1mUbK7-0006hY-67; Sun, 26 Sep 2021 23:04:35 +0200 Received: by submission02.runbox with esmtpsa [Authenticated ID (524175)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1mUbK0-00080c-Df; Sun, 26 Sep 2021 23:04:28 +0200 Message-ID: Date: Sun, 26 Sep 2021 14:04:23 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: Recursive define-syntax Content-Language: en-US To: Philippe de Rochambeau , kawa@sourceware.org References: <52C4B57C-283E-4D90-A941-5A6FDA76EA73@free.fr> From: Per Bothner In-Reply-To: <52C4B57C-283E-4D90-A941-5A6FDA76EA73@free.fr> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org 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: Sun, 26 Sep 2021 21:04:38 -0000 On 9/26/21 05:08, Philippe de Rochambeau via Kawa wrote: > > Hello, > > the following procedure, excerpted from « A Pamphlet Against R » > > (define (dim m) > (match m > ((first . rest) > `(,(length m) . ,(dim first))) > (_ > '()))) > > … causes Kawa to display the following error message: > > /dev/tty:6:5: unrecognized pattern operator first There is no standard Scheme 'match' syntax - there are a number of different and incompatible extensions. « A Pamphlet Against R » uses the Guile language, which is quite different frm Kawa. Specifically, the Kawa "pattern" syntax is quite limited - it is mainly a proof of concept - a test of the basic framework. Thar said, this seems to work: (define (dim m) (match m ([first rest ...] `(,(length m) . ,(dim first))) (_ '()))) (dim m0) => (3 4) > Are recursive « syntaxes » not possible in Kawa? 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 limitation. -- --Per Bothner per@bothner.com http://per.bothner.com/