public inbox for
 help / color / mirror / Atom feed
From: Per Bothner <>
To: Panicz Maciej Godek <>,
Subject: Re: "define-constant is only allowed in a <body>"
Date: Sun, 20 Nov 2022 14:41:28 -0800	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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:
> 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.

Kawa is presumably complaining that the define-early-constant is
in a non-<body> 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

  reply	other threads:[~2022-11-20 22:41 UTC|newest]

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

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

  git send-email \ \ \ \ \

* 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).