public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
* Environment initialization on Android
@ 2022-10-31 10:51 Panicz Maciej Godek
  2022-10-31 16:25 ` Per Bothner
  0 siblings, 1 reply; 3+ messages in thread
From: Panicz Maciej Godek @ 2022-10-31 10:51 UTC (permalink / raw)
  To: kawa

[-- Attachment #1: Type: text/plain, Size: 845 bytes --]

I've been fiddling with an Android app built with Kawa, and running Kawa,
and I've noticed something weird:

when I make a "global definition" (in the module containing the definition
of Android's activity), then the object bound to a given name is a null -
if it's a 'compound object' (like StringBuilder or parameter object, or an
object created by define-simple-class). But there are some exceptions: if I
use objects such as an integer number or a string, then dereferencing them
yields the right values.

My bet is that there must be some difference between JVM and Android - and
that perhaps I need to initialize something manually in order to have
access to the compound objects.

Can anyone help?

The current source file of my app is here:

https://github.com/panicz/grasp-android/blob/master/stages/retreat/GRASP/src/grasp-android.scm

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Environment initialization on Android
  2022-10-31 10:51 Environment initialization on Android Panicz Maciej Godek
@ 2022-10-31 16:25 ` Per Bothner
  2022-11-02  8:10   ` Panicz Maciej Godek
  0 siblings, 1 reply; 3+ messages in thread
From: Per Bothner @ 2022-10-31 16:25 UTC (permalink / raw)
  To: Panicz Maciej Godek, kawa



On 10/31/22 03:51, Panicz Maciej Godek via Kawa wrote:
> when I make a "global definition" (in the module containing the definition
> of Android's activity), then the object bound to a given name is a null -
> if it's a 'compound object' (like StringBuilder or parameter object, or an
> object created by define-simple-class). But there are some exceptions: if I
> use objects such as an integer number or a string, then dereferencing them
> yields the right values.

Literal and static values can be evaluated and initialized in multiple
locations: the class initialize; and object initialized; the "run" method.
Where things are initialized may depend on compiler flags (such as --module-static)
and what kind of object is being initialized. I don't remember exactly what
happens when; it has changed over the years.

So it is possible the Android environment may cause some step in the initialization
to be skipped or things to be done in the wrong order.
-- 
	--Per Bothner
per@bothner.com   http://per.bothner.com/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Environment initialization on Android
  2022-10-31 16:25 ` Per Bothner
@ 2022-11-02  8:10   ` Panicz Maciej Godek
  0 siblings, 0 replies; 3+ messages in thread
From: Panicz Maciej Godek @ 2022-11-02  8:10 UTC (permalink / raw)
  To: Per Bothner; +Cc: kawa

[-- Attachment #1: Type: text/plain, Size: 1309 bytes --]

Thanks,
so far I've figured out that some issues can be resolved by using
define-early-constant wherever possible.

pon., 31 paź 2022, 17:26 użytkownik Per Bothner <per@bothner.com> napisał:

>
>
> On 10/31/22 03:51, Panicz Maciej Godek via Kawa wrote:
> > when I make a "global definition" (in the module containing the
> definition
> > of Android's activity), then the object bound to a given name is a null -
> > if it's a 'compound object' (like StringBuilder or parameter object, or
> an
> > object created by define-simple-class). But there are some exceptions:
> if I
> > use objects such as an integer number or a string, then dereferencing
> them
> > yields the right values.
>
> Literal and static values can be evaluated and initialized in multiple
> locations: the class initialize; and object initialized; the "run" method.
> Where things are initialized may depend on compiler flags (such as
> --module-static)
> and what kind of object is being initialized. I don't remember exactly what
> happens when; it has changed over the years.
>
> So it is possible the Android environment may cause some step in the
> initialization
> to be skipped or things to be done in the wrong order.
> --
>         --Per Bothner
> per@bothner.com   http://per.bothner.com/
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-11-02  8:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-31 10:51 Environment initialization on Android Panicz Maciej Godek
2022-10-31 16:25 ` Per Bothner
2022-11-02  8:10   ` Panicz Maciej Godek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).