[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: module trickery
From: |
Marius Vollmer |
Subject: |
Re: module trickery |
Date: |
31 Aug 2002 17:01:30 +0200 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 |
address@hidden (Thomas Bushnell, BSG) writes:
> 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.
Here is something that works with 1.5.8 and CVS HEAD. I don't know
whether it works with the 1.4 series, tho. Is it similar enough to
what you are doing?
(define-module (python syntax)
:use-syntax (ice-9 syncase))
(define-syntax foo
(syntax-rules ()
((_ a)
(display a))))
(define-module (test))
(define python-toplevel (make-module))
(beautify-user-module! python-toplevel)
(module-use! python-toplevel (resolve-module '(python syntax)))
(eval '(foo "hi\n") python-toplevel)
Running it produces:
$ guile -s x.scm
hi
Thus, it seems that no additional tricks are needed, which is a good
thing.
--
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3 331E FAF8 226A D5D4 E405