[plt-scheme] Problem with defmacro and modules

From: Andreas Rottmann (a.rottmann at gmx.at)
Date: Thu Mar 1 06:34:36 EST 2007

Hi!

I stumbled across strange behaviour using mzscheme 360; the following
code will fail with "reference to undefined identifier: module":

;;-----------------------------------------------------------------
(module baz (lib "r5rs.ss" "r5rs"))

(module foo mzscheme
  (require baz)
  (provide expand-foo)
  (define (expand-foo form)
    'foo-expansion))
  
(module bar mzscheme
  (require (lib "defmacro.ss"))
  (require-for-syntax foo)
  (provide bar)
  (define-macro (bar . forms) (expand-foo (cons 'bar forms))))

(module qux mzscheme
  (require bar))
;;------------------------------------------------------------------

I guess this is a bug in defmacro and/or the module system. Any ideas?

Thanks, Rotty
-- 
Andreas Rottmann         | Rotty at ICQ      | 118634484 at ICQ | a.rottmann at gmx.at
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

A. Because it breaks the logical sequence of discussion
Q. Why is top posting bad?


Posted on the users mailing list.