This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: "no declaration seen" warnings on compile but not when running in interpreter


On 02/01/2010 08:11 PM, alex mitchell wrote:
I'm getting a string of "no declaration seen" warnings when compiling my
code, warnings which don't appear when I run inside the interpreter. I had
the "--warn-undefined-variable" flag set in both compiler and interpreter.
If I turn off the warning flag in the compiler, I get "unbound location"
errors when I run the resulting classes.

Note that the declarations that the compiler complains about are definitely
there, and the interpreter is finding them, but the compiler isn't. Is
anyone else having any problems like this?

Can the compiler see the declarations at compile-time? I.e. is it available using lexical scoping rules? (Or by doing a dynamic lookup at compile-time, which rather a hack for getting the builtin environment.)

If the variable needs dynamic lookup in the run-time environment.
the the warning is correct - but it should then fall back to
dynamic lookup, so it should find the variable at compile-time.
But it is possible that the declaration isn't "exported".

Note a recent change (from the news.html file):

  Top-level bindings in a module compiled with --main are now
  implicitly module-private, unless there is an explicit module-export.

You might want to change your declaration to use define-variable,
if you want it to be dynamic.  If you want it to be lexical, make
sure it is exported by the defining module, and imported by the
using module.
--
	--Per Bothner
per@bothner.com   http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]