[plt-scheme] Conflicts in require statements

From: Sverrir Valgeirsson (e96sv at yahoo.se)
Date: Fri Feb 16 13:22:42 EST 2007

You could use prefix to solve the problem (but how to identfy what modules are causing the problem is another issue that I can't help with..)

(module module 3 mzscheme
    (require (prefix m1: module1))
    (require (prefix m2: module2))
     (printf "~a~n" m1:a))

Hope this helps

----- Original Message ----
From: Dave Gurnell <d.j.gurnell at gmail.com>
To: plt-scheme at list.cs.brown.edu
Sent: Friday, February 16, 2007 4:20:26 PM
Subject: [plt-scheme] Conflicts in require statements

Dear All,

I quite often get collisions in the names of procedures required from  
two or more modules:

     (module module1 mzscheme
        (define a 1)
        (define b 2)
        (provide a b))

     (module module2 mzscheme
        (define a 10)
        (define c 20)
        (provide a c))

     (module module3 mzscheme
        (require module1 module2)
        (printf "~a~n" a))

Trying to compile this lot gives the error message:

     module: identifier already imported (from a different source) in: a

Rather frustratingly, this message doesn't say *where* the colliding  
names come from. It's obvious in this example, but in modules with  
lots of requirements I sometimes end up commenting lines out one by  
one until changes in the error message reveal the source of the problem.

Am I missing an easy way of finding these collisions when it isn't  


-- Dave

  For list-related administrative tasks:

Flyger tiden iväg? Fånga dagen med Yahoo! Mails inbyggda
kalender. Dessutom 250 MB gratis, virusscanning och antispam. Få den på: http://se.mail.yahoo.com

Posted on the users mailing list.