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: compilation (and some CLOS)


balaban ittai <ittaib@cs.bgu.ac.il> writes:

> I have this innocent little module, tiny_clos.scm.
> I compile this, then write some scheme code saying (require <tiny_clos>)
> at the top. This code loads fine in the interpreter. When I compile this
> code, I get the following:
> 
> (compiling scheme_agent_interface.scm)
> Internal error while compiling scheme_agent_interface.scm
> Argument #0 to `vector-ref' has wrong type (java.lang.Boolean)
> 	at gnu.mapping.WrongType.make(WrongType.java:56)
> 	at tiny_clos.lambda4(tiny_clos.scm, Compiled Code)
>
> Now, when I change the (require ...) to (load ...) things are fine. ?

Well, there isn't much to go on here.

First, I've noticed that JDK1.2 is bad about giving line numbers
in a stack trace.  I don't know if there is a way to fix that.
I've noticed 1.2 won't give me line numbers, where JDK 1.1 or
Kaffe will give me line numbers.

The compiler does some inlining which may break some technically-legal
code.  For example, if you assign to vector-ref, bad things are likely
to happen!  (I do plan on adding a "dont-inline" flag - but it doesn't
seem to have been an issue so far.)  It is also quite possible that
code that works when loaded will break when required.  Do note
that require and the other module-related commands only work when
compiling.  The main reason for that is that load evaluates a file
command-at-at-time, while compiling reads the whole file as a unit.
(I intend to change load so it too processes the whole file as a
unit.  However, that will break some code, and I want to have fixes or
work-arounds for the breakage.)

> BTW Are there recommendations for a source-only CLOS-type thing for Scheme
> (/ Kawa)?

I don't have any experience with such a package.  I do intend to implement
something vaguely CLOS-like.  (I would like to make it practical to
write object-oriented programs that work under both Guile using "GOOPS"
and Kawa, though I probably won't implement all of GOOPS's features.)
I don't know when I'll have something useful - but it does seem that
some form of define-class is the most requested feature for Kawa, so
it is near the top of the todo-list.
-- 
	--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]