[plt-scheme] Conflicts in require statements
Hi,
Using (require (only libspec import ...) ...) I avoid the problem of name
collissions. Another advantage of 'only' is, imho, that it makes you and the
reader aware what exactly is required. Another way to avoid the problem is
'prefix'.
(((((lambda(x)((((((((x x)x)x)x)x)x)x)x))
(lambda(x)(lambda(y)(x(x y)))))
(lambda(x)(x)x))
(lambda()(printf "Greetings, Jos~n"))))
----- 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 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
> obvious?
>
> Cheers,
>
> -- Dave
>
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>