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 C7D453858CDA for ; Sun, 20 Nov 2022 22:41:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org C7D453858CDA 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 1owt0P-00ALES-Iu; Sun, 20 Nov 2022 23:41:41 +0100 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=H2YRrLv2LUrR1sQhIaF/HPlxaXwH6hDNGbDp8tQQbsA=; b=qdeYZob2g84TPZ3QfaDzlTUgNj QdB+ViluvC/q/wpvWiDb7THQ3GkQB6oEzEebgF3gcrX8rESBWbO4TpZrc+RAbnak5cO1OUgZSid9f g2dfsyiSDhO5/yJkudFR+IhdY0hIb+BWKPSHFFVTUp0pD54gGYDYtvPGyH9QtjZnQHc0faZAJQ48E 1NT1bX91B51uzEpY923E8vmLJJxd8Pu05/4lEZut0+x0DlO18wTyvQY3D7RY5raYyJch7SeXzkbNN Wry99BWU54eazrCckP16VBgT1/QuPOdBC2hKXld3nb/i08ROTknXmIa9enhH5XOGGwlV2ztQn6ck1 dHmhLX8w==; Received: from [10.9.9.74] (helo=submission03.runbox) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1owt0O-0002JN-Ri; Sun, 20 Nov 2022 23:41:41 +0100 Received: by submission03.runbox with esmtpsa [Authenticated ID (524175)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1owt0K-0003Wn-A0; Sun, 20 Nov 2022 23:41:36 +0100 Message-ID: <6d811ecb-2c95-a973-9e78-279f5e608883@bothner.com> Date: Sun, 20 Nov 2022 14:41:28 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.1 Subject: Re: "define-constant is only allowed in a " Content-Language: en-US To: Panicz Maciej Godek , kawa@sourceware.org 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=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 11/19/22 06:37, Panicz Maciej Godek via Kawa wrote: > When I try to use this code from yet another module -- more specifically, > this one: > > https://github.com/panicz/grasp-android/blob/master/stages/retreat/GRASP/src/panel.scm#L130 > > as > > (define-mapping (on-key-press code) never) > > I get the error message > > define-constant is only allowed in a > > but when I use the expanded version > > (define on-key-press (mapping (code) never)) > > everything works. > > I wonder what could be the reason of Kawa's behavior. Kawa is presumably complaining that the define-early-constant is in a non- context. This is allowed: (begin (define-early-constant ...) ...) This is not: (list (define-early-constant ...) ...) One of the problems with Scheme S-expression-based syntax is that it is sometimes tricky to tell what parenthesis does what. For example, it is easy to end up with this after some macro-expansion: ((define-early-constant ...)) -- --Per Bothner per@bothner.com http://per.bothner.com/