chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Chicken-users] syntax-case modules questions


From: Andreas Rottmann
Subject: [Chicken-users] syntax-case modules questions
Date: Fri, 25 May 2007 01:08:00 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux)

Hi!

Since Chicken lacks a built-in module system, I'm playing with the
syntax-case egg. I want to take an extension (say SRFI-39) and make
that (or parts of it) available as a syntax-case module. It seems I
have to use EXPORT-TOPLEVEL instead of the export list, since this
doesn't work:

(module foo (append!)
  (require-extension srfi-1))
===>
Error: missing definition for export(s): (append!)

This works:

(module foo ()
  (require-extension srfi-1)
  (export-toplevel append!))

So now, the question is what to do about syntax (i.e. macros). The
syntax-case egg docs mention that EXPORT-TOPLEVEL doesn't support
syntax. So how would I export a macro imported from an extension
loaded with REQUIRE-EXTENSION? This doesn't work:

(module spells.parameter (parameterize)
  (require-extension srfi-39)
  (export-toplevel make-parameter))
===>
Error: missing definition for export(s): (parameterize)

Any ideas?

Another thing that I noticed when using the syntax-case egg is that
INCLUDEs are not relative to the file containing the module
declaration, but I think they should be. So given a file
"some/dir/modules.scm":

(module foo (bar)
  (include "foo.scm"))

Now running "csi -R syntax-case some/dir/modules.scm" should look in
"some/dir" for foo.scm instead of the current directory. This is also
what happens in mzscheme when using the INCLUDE syntax.

Cheers, Rotty
-- 
Andreas Rottmann         | address@hidden      | address@hidden | address@hidden
http://rotty.uttx.net    | GnuPG Key: http://rotty.uttx.net/gpg.asc
Fingerprint              | C38A 39C5 16D7 B69F 33A3  6993 22C8 27F7 35A9 92E7
v2sw7MYChw5pr5OFma7u7Lw2m5g/l7Di6e6t5BSb7en6g3/5HZa2Xs6MSr1/2p7 hackerkey.com

Anonymous surfing? Use Tor: http://tor.eff.net




reply via email to

[Prev in Thread] Current Thread [Next in Thread]