This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
duplicate definition
- From: Chris Dean <ctdean at sokitomi dot com>
- To: Kawa List <kawa at sources dot redhat dot com>
- Date: Fri, 15 Oct 2004 11:06:22 -0700
- Subject: duplicate definition
(I think this has been asked before, but I don't remember the answer.)
Consider three modules A, B, and C. B has a macro that uses a
function in A and C requires both A and B. When I compile C, I get a
duplicate definition warning.
How do I not get the warning?
Thanks!
Regards,
Chris Dean
--- /dev/null Tue Sep 14 23:30:46 2004
+++ A.scm Fri Oct 15 11:03:04 2004
@@ -0,0 +1,5 @@
+(module-name <A>)
+(module-static #t)
+
+(define (func-a)
+ '(i am A))
--- /dev/null Tue Sep 14 23:30:46 2004
+++ B.scm Fri Oct 15 11:03:08 2004
@@ -0,0 +1,10 @@
+(module-name <B>)
+(module-static #t)
+
+(require <A>)
+
+(define-syntax macro-b
+ (syntax-rules ()
+ ((macro-b)
+ (append (func-a) '(and i am B)))))
+
--- /dev/null Tue Sep 14 23:30:46 2004
+++ C.scm Fri Oct 15 11:03:12 2004
@@ -0,0 +1,13 @@
+(module-name <C>)
+
+(require <A>)
+(require <B>)
+
+(define (func-c)
+ (append (macro-b) '(and me am C)))
+
+(define (main)
+ (func-c))
+
+(format #t "Result: ~S~%" (main))
+