unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Jean Abou Samra <jean@abou-samra.fr>
To: Maxime Devos <maximedevos@telenet.be>,
	Damien Mattei <damien.mattei@gmail.com>,
	guile-user <guile-user@gnu.org>
Subject: Re: error Wrong type to apply: #<syntax-transformer
Date: Wed, 09 Aug 2023 15:22:43 +0200	[thread overview]
Message-ID: <947f320f532f3f38db98e325f8cfdbc95a45e559.camel@abou-samra.fr> (raw)
In-Reply-To: <9b47720a-eefb-5bd5-91b7-d7f4eb124986@telenet.be>

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

Le mercredi 09 août 2023 à 11:42 +0200, Maxime Devos a écrit :
> 
> 
> Op 09-08-2023 om 01:00 schreef Jean Abou Samra:
> > Le mardi 08 août 2023 à 21:38 +0200, Maxime Devos a écrit :
> > > As such, this not working on the top-level seems a bug to me -- after
> > > all, a module definition is conceptually just a big let:
> > > 
> > > <enable extra reader syntax> (if applicable)
> > > (let ()
> > >     <magic to make imports work>
> > >     (define ...)
> > >     (define-syntax-rule ...) ...
> > >     ;; use a new macro using syntax-local-binding
> > >     ;; to extract the syntax transformer (*).
> > >     <insert stuff in hash tables>)
> > > 
> > > (*) not sure if that precise approach actually works in this context
> > 
> > 
> > 
> > This is very tempting to believe, and I wish it were true, but it's not
> > true.
> > 
> > At least in Guile, the <insert stuff in hash tables> part doesn't happen
> > at the end of evaluating the module. Each module variable is created and
> > inserted while evaluating the define form. Otherwise this would give
> > an error:
> > 
> > (define a 5)
> > (define b (module-ref (current-module) 'a))
> > (display b)
> 
> I don't see a problem here, only a little backwards-incompatibility (I 
> mean, you could just ... not do that, and do (define b a) instead).



I didn't say that it couldn't be improved, only that it didn't work like you
described in current Guile.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

      parent reply	other threads:[~2023-08-09 13:22 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-03  9:09 error Wrong type to apply: #<syntax-transformer Damien Mattei
2023-08-03  9:36 ` Damien Mattei
2023-08-03  9:58   ` Jean Abou Samra
2023-08-03 11:01     ` Damien Mattei
2023-08-04  8:23       ` Damien Mattei
2023-08-04  8:31         ` Jean Abou Samra
2023-08-04 12:45           ` Damien Mattei
2023-08-08 19:38     ` Maxime Devos
2023-08-08 20:17       ` Damien Mattei
2023-08-08 23:00       ` Jean Abou Samra
2023-08-09  9:42         ` Maxime Devos
2023-08-09 10:25           ` Maxime Devos
2023-08-09 13:22           ` Jean Abou Samra [this message]

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=947f320f532f3f38db98e325f8cfdbc95a45e559.camel@abou-samra.fr \
    --to=jean@abou-samra.fr \
    --cc=damien.mattei@gmail.com \
    --cc=guile-user@gnu.org \
    --cc=maximedevos@telenet.be \
    /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).