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: NullPointerException on android when calling load




On 11/17/2014 09:01 PM, Ben Simon wrote:
On Mon, Nov 17, 2014 at 2:13 PM, Per Bothner <per@bothner.com> wrote:
Just be aware that we can't create bytecode on-the-fly in Android, so
load (or eval) has to use the Kawa interpreter, which doesn't have the
same or full functionality (compare to the compiler), and which gets less
testing.

Are the limitations outlined somewhere, or is it more trial-and-error?

No, I don't have a list.  You won't be able to do define-class or
define-simple-class.  Resolution of overloaded methods may be subtly different.
You can't do invoke-special.  I'm sure there are others.

The first step is figuring out why either inherited or inherited[i] is null
even though numInherited>0.

I dropped in a few System.err.println's and here's what I've learned:

a) numInherited = 0, and inherited[i] == null - just like you suggested

I assume you mean  numInherited == 1 - otherwise the loop in lookupInherited
would be skipped.

b) I added a println to the  InheritingEnvironment constructor and
found that it was getting invoked once:
    name = main, parent = null

c) I also confirmed that InheritingEnvironment.addParent is being
called once, and it's being passed null.  No great surprise here, as
the constructor for InheritingEnvironment calls addParent.

Where should I look next?

Looks like Environment.global is not being set.

Try adding a call to:

  Scheme.registerEnvironment();

before the load.
--
	--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]