This is the mail archive of the kawa@sourceware.cygnus.com 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]

Re: How does Kawa's define_proc() call work?


"Nic Ferrier" <nferrier@tapsellferrier.co.uk> writes:

> Since kawa.lib.files is a scm file and not a class I can't work out
> what this is doing. 

It is a class - after it has been compiled.  On a Unix-like system,
it gets compiled automatically when you do a top-level make.  On other
systems, you can compile it manually (see the manual) or use
kawa-compiled-XXX.zip.

> As far as I can see it should be handled by class AutoloadProcedure
> but that doesn't seem to be handling .scm files either.

It does - it only loads .class files.  However, it handles two kinds of
class files:
* If the class inherits from ModuleBody, then *all* the declarations
of the compiled module file are added to the environment.
* Otherwise, the class must be a regular procedure (inherit from
Procedure), and it is added to the environment as is.

This is intended to change with the new module system.  The idea
is that the compiler when it sees a variable or function FOO
bound in module MOD, it will generte a field reference FOOM
or method reference FOOM (where "FOOM" is the "mangling" of "FOO")
to a variable module$MOD.  (This is only define when the compiler
see a name it knows about, and you'll be able to turn it off.)

There also be an option to use static (field or method) references
to access bindings.  This has various performance advantages, including
being able to piggy-back of the JVM's class-loading feature.  There are
some tradeoffs, though, so it may be only an option.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/~per/

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