This is the mail archive of the
kawa@sourceware.org
mailing list for the Kawa project.
Question about command-line-arguments and main method
- From: Matthieu Vachon <matthieu dot o dot vachon at gmail dot com>
- To: kawa at sourceware dot org
- Date: Mon, 4 Feb 2013 13:15:00 -0500
- Subject: Question about command-line-arguments and main method
Hi,
I hit a small problem with the variable `command-line-arguments`. The
compiler is always complaining that this variable is not declared.
Here the module I used (named `test.scm`):
(module-name <org.kawa.warning>)
(if (eq? command-line-arguments '#())
(format (current-output-port) "No command arguments provided~%")
(format (current-output-port) "Command arguments: ~a~%"
command-line-arguments))
And here the output produced by the compiler when doing `java
kawa.repl -d obj -C test.scm`:
(compiling src/scheme/test.scm to org.kawa.warning)
src/scheme/test.scm:3:10: warning - no declaration seen for
command-line-arguments
src/scheme/test.scm:5:61: warning - no declaration seen for
command-line-arguments
Is it a problem with how I use the variable? Is it a bug in the
compiler? This is a problem because we plan to treat error as warning
using `--warn-as-error` and this prevents compilation of those units.
I would also like to know if it's possible to produce a `.class` that
has a static main method in it so it's possible to call directly (.i.e
`java org.kawa.main` for example)?
Thanks in advance :)
Regards,
Matt