This is the mail archive of the kawa@sources.redhat.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]
Other format: [Raw text]

RE: define-class and define-simple-class don't work in the latest versions


Per Bothner wrote:

> I'm fairly sure there has not been any regression - i.e. I don't
> think define-simple-class at the command-line has ever worked.

Ok, this may be wishful memory on my part.

> As I said:  I believe this should work, but it is an issue to be aware
> of.  What does not seem to currently work is compiling a a file like
> "test-one.scm", but that should be a simple fix.

I think it would be helpful to expand the section covering define-class and
define-simple-class in the docs to include the information that these define
classes to be compiled and a sample file including all declarations (if any)
including the filename. Someone like me could then cut the text from the
docs, paste it into the appropriate named file, compile it, invoke kawa and
instantiate the classes. A little something about the purpose of these
methods would be nice as well. I started with the assumption that you were
providing a way to dynamically create classes in scheme that would be
accessible to other java classes if compiled but would be accessible to
scheme methods and classes in any event. I understand now that these methods
are not to create dynamic classes. I was coming from using Wade Humeniuk's
Macroless Object System to create scheme classes in kawa. I think its
penetrated my thick skull finally what you're trying to do with define-class
and define-simple-class.

> It is definitely a convenience.  I don't see it as being all that useful
> for most applications, except perhaps for applications that dynamically
> load new code.

Or allow new classes to be written and hot-loaded into a running app.


Thanks for your patience,

Cheers,

Willy


-----Original Message-----
From: Per Bothner [mailto:per@bothner.com]
Sent: Wednesday, January 02, 2002 2:58 PM
To: Heineman, William P
Cc: 'kawa@sources.redhat.com'
Subject: Re: define-class and define-simple-class don't work in the
latest versions


Heineman, William P wrote:

> 
> Understood. I based my assumptions on the first release of this feature,
> where it worked as described.


I'm fairly sure there has not been any regression - i.e. I don't
think define-simple-class at the command-line has ever worked.

 > The docs should mention the restriction, accordingly.

I'll put in a note to this effect.


>>Another potential problem is that the names 'test-one' and 'test-two'
>>are not valid Java class names, so they need to be "mangled".  Kawa
>>should do this automatically, but it is an issue to be aware of.
>
> Same as above. The examples in the docs are '2d-vector' and '3d-vector'.


As I said:  I believe this should work, but it is an issue to be aware
of.  What does not seem to currently work is compiling a a file like
"test-one.scm", but that should be a simple fix.


>  Thanks for your reply. I'll dig into the class loader docs myself. I seem
to
> recall there's a fix or workaround to the garbage collection issue in the
> latest versions of the JVM (1.3 and higher).


It may be acceptable to create a temporary class-cloader for temporary
classes (i.e. those modules tha don't do define-simple=class or
  define-simple-class), which inherit from a global (or per-Interpreter)
"permanent" class-loader.

> I really think dynamic class
> definition is a plus, if not a requirement for everybody.


It is definitely a convenience.  I don't see it as being all that useful
for most applications, except perhaps for applications that dynamically
load new code.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


LEGAL NOTICE
Unless expressly stated otherwise, this message is confidential and may be privileged. It is intended for the addressee(s) only. Access to this E-mail by anyone else is unauthorized. If you are not an addressee, any disclosure or copying of the contents of this E-mail or any action taken (or not taken) in reliance on it is unauthorized and may be unlawful. If you are not an addressee, please inform the sender immediately.


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