From: tb@becket.net (Thomas Bushnell, BSG)
Cc: guile-devel@gnu.org
Subject: Re: module trickery
Date: 30 Aug 2002 16:02:34 -0700 [thread overview]
Message-ID: <87ptw0ymph.fsf@becket.becket.net> (raw)
In-Reply-To: <87y9apqtyt.fsf@zagadka.ping.de>
Marius Vollmer <mvo@zagadka.ping.de> writes:
> tb@becket.net (Thomas Bushnell, BSG) writes:
>
> > (module-use! special-module (resolve-module '(python syntax)))
> >
> > The (python syntax) module creates syntax with define-syntax, and does
> > nothing out of the ordinary.
> >
> > When I evaluate expressions in special-module which use the syntax
> > defined in (python syntax), things go into an infinite loop. The
> > macro I'm testing is blindingly simple and works fine in a normal
> > environment.
>
> Please try what happens when you also do
>
> (use-modules (ice-9 syncase))
> (module-use! special-module (resolve-module '(ice-9 syncase)))
> (set-module-transformer! special-module syncase)
>
> The 'module transformer' needs to be set up so that syntax-case
> expansion can work.
No discernable effect. Here is exactly what I have so far...
The macros are defined inside (define-module (python syntax)).
Then I want to incorporate those macros into my special module; which
is set up as follows:
(define python-toplevel (make-module))
(beautify-user-module! python-toplevel)
(module-use! python-toplevel (resolve-module '(python syntax)))
(module-use! python-toplevel (resolve-module '(ice-9 syncase)))
(set-module-transformer! python-toplevel syncase)
;;; Insert the definitions of the (python __builtin__) module
;;; into python-toplevel. Note that this is not an import: we
;;; do *not* share bindings with the module. That's because we
;;; shouldn't allow sets here to blow them away.
(module-for-each
(lambda (name variable)
(module-define! python-toplevel name (variable-ref variable)))
(resolve-module '(python __builtin__)))
Then I want to evaluate expressions inside this module with the
following:
(eval-in-module SEXP python-toplevel)
I'm quite flexible here... anything that lets me set up the relevant
module and do eval-in-module will be fine by me. Switching from Guile
1.4 to the latest 1.5 test release is not unacceptible, if it will
really work.
Thomas
_______________________________________________
Guile-devel mailing list
Guile-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/guile-devel
next prev parent reply other threads:[~2002-08-30 23:02 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-08-28 23:28 module trickery Thomas Bushnell, BSG
2002-08-29 20:40 ` Marius Vollmer
2002-08-30 23:02 ` Thomas Bushnell, BSG [this message]
2002-08-31 2:58 ` Rob Browning
2002-08-31 15:01 ` Marius Vollmer
2002-09-03 21:52 ` Thomas Bushnell, BSG
2002-09-03 22:11 ` Thomas Bushnell, BSG
2002-09-04 19:35 ` Marius Vollmer
2002-09-04 20:12 ` Tom Lord
2002-09-05 16:52 ` Marius Vollmer
2002-09-04 20:14 ` Marius Vollmer
2002-09-04 22:21 ` Thomas Bushnell, BSG
2002-09-04 22:40 ` Marius Vollmer
2002-09-04 23:33 ` Thomas Bushnell, BSG
[not found] ` <87r8g9uy8d.fsf@becket.becket.net>
2002-09-05 19:37 ` Marius Vollmer
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=87ptw0ymph.fsf@becket.becket.net \
--to=tb@becket.net \
--cc=guile-devel@gnu.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).