public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Panicz Maciej Godek <godek.maciek@gmail.com>
To: kawa@sourceware.org
Subject: "define-constant is only allowed in a <body>"
Date: Sat, 19 Nov 2022 15:37:16 +0100	[thread overview]
Message-ID: <CAMFYt2awE_4SU9GYhKaoaG3JCiotKMech+B_j10SqD=an1sTbQ@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1010 bytes --]

I have a module named (mapping), which contains a thing that I have called
"mapping", which is a nice functional interface to mutable hash tables
(based on SRFI-17):

https://github.com/panicz/grasp-android/blob/master/stages/retreat/GRASP/src/mapping.scm

Therein, you can also find the following definition of define-mapping:

(define-syntax-rule (define-mapping (mapping-name key) default-value)
   (define-early-constant mapping-name
      (mapping (key) default-value)))

where define-syntax-rule is defined in a straightforward way in another
module.

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 <body>

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.

             reply	other threads:[~2022-11-19 14:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-19 14:37 Panicz Maciej Godek [this message]
2022-11-20 22:41 ` Per Bothner
2022-11-20 23:29   ` Panicz Maciej Godek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAMFYt2awE_4SU9GYhKaoaG3JCiotKMech+B_j10SqD=an1sTbQ@mail.gmail.com' \
    --to=godek.maciek@gmail.com \
    --cc=kawa@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).