This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
What is the use of (require <xyz>) and explicit type declarations ?
- From: Chris Dean <Chris dot Dean at sokitomi dot com>
- To: "Hoehle, Joerg-Cyril" <Joerg-Cyril dot Hoehle at t-systems dot com>
- Cc: kawa at sources dot redhat dot com
- Date: Thu, 13 Nov 2003 10:45:15 -0800
- Subject: What is the use of (require <xyz>) and explicit type declarations ?
- References: <9F8582E37B2EE5498E76392AEDDCD3FE07DEE1EC@G8PQD.blf01.telekom.de>
Hoehle, Joerg-Cyril <Joerg-Cyril.Hoehle@t-systems.com> wrote:
> What is the use of a require "statement" w.r.t. file-compilation?
The require form makes symbols that exist in one module available in
another. It doesn't really work for plain java classes.
A simple example with two files is below.
Regards,
Chris Dean
--- /dev/null Tue Dec 10 02:57:38 2002
+++ Foo.scm Thu Nov 13 10:43:09 2003
@@ -0,0 +1,5 @@
+(module-name <Foo>)
+(module-static #t)
+
+(define (foo-function)
+ 'hello)
--- /dev/null Tue Dec 10 02:57:38 2002
+++ Bar.scm Thu Nov 13 10:43:12 2003
@@ -0,0 +1,7 @@
+(module-name <Bar>)
+(module-static #t)
+
+(require <Foo>)
+
+(define (bar)
+ (foo-function))