From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailtransmit04.runbox.com (mailtransmit04.runbox.com [IPv6:2a0c:5a00:149::25]) by sourceware.org (Postfix) with ESMTPS id E274B3858C3A for ; Thu, 12 Oct 2023 21:33:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E274B3858C3A 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 mailtransmit03.runbox ([10.9.9.163] helo=aibo.runbox.com) by mailtransmit04.runbox.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1qr3JK-002Xic-SU; Thu, 12 Oct 2023 23:33:38 +0200 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=bothner.com ; s=selector1; h=Content-Transfer-Encoding:Content-Type:In-Reply-To:From: References:To:Subject:MIME-Version:Date:Message-ID; bh=KCG7I2w0alUBcOPzxzNbomiUeveq//GSI0jZJxwQT5s=; b=pywbXhjx47g+MyyhC59ftW86pr JWfyxF5ofFh8+ij3LAknSp0BJ9F0S1Se/90i6YfBjWLleqnbsuf3bK/+N6oRcpJtEE9o3St/jU35O cnE+KfVIjoOG5EluT+Tubqc3v0RHJHTm8QbTgb2itKOBhV4mLBrlG7+hxWOY6vFzBnzAaidL2i7Ny jEoWe7OEojDyzfL1ruDNYxOcdCifI0X+SGKYniDZ6FgKH7uj0IDYV75tNyshuiyQNOP8IX/J2DPo4 VDezbecKOBiDieQQTpfhTJDtil8AmPCvDPWN/LNRcQpPs9QR6NpSyV520E0kAZBGr7q0GyX44pt5I P1XmcVuw==; Received: from [10.9.9.72] (helo=submission01.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1qr3JK-00062Y-EJ; Thu, 12 Oct 2023 23:33:38 +0200 Received: by submission01.runbox with esmtpsa [Authenticated ID (524175)] (TLS1.2:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim 4.93) id 1qr3J6-00754L-FA; Thu, 12 Oct 2023 23:33:24 +0200 Message-ID: <14dbe843-4f61-a324-96d7-6e5bf9a53136@bothner.com> Date: Thu, 12 Oct 2023 14:33:14 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: macro definition in module Content-Language: en-US To: Damien Mattei , kawa mailing list References: From: Per Bothner In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,NICE_REPLY_A,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: On 10/12/23 14:19, Damien Mattei via Kawa wrote: > i know how to define a function in module,example > > ;; file ModuleName.scm > > (define-simple-class ModuleName () > > ((string-null? str) > (string=? str ""))) > > but this syntax can help me to define a macro in module, is it possible? Your example defines a method in a class (in a module). Each module is compiled to a "module class" but when a module contains a simple class with the same name, they are combined: https://www.gnu.org/software/kawa/Module-classes.html#Same-class-for-module-and-defined-class However, if you want to define a macro in a module, you have you have to use a separate module class, because you can't define a macro in a simple class. I suggest reading this thoroughly: https://www.gnu.org/software/kawa/Module-classes.html -- --Per Bothner per@bothner.com http://per.bothner.com/