This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: define-simple-class first use comments
- To: "Heineman, William P" <william_p_heineman at groton dot pfizer dot com>
- Subject: Re: define-simple-class first use comments
- From: Per Bothner <per at bothner dot com>
- Date: 30 Aug 2001 11:57:05 -0700
- Cc: "'kawa at sources dot redhat dot com'" <kawa at sources dot redhat dot com>
- References: <9A0C759692D3D411A31A00805FA749AD644289@groexmbcr13bak.pfizer.com>
"Heineman, William P" <william_p_heineman@groton.pfizer.com> writes:
> 1. Field names can not have hyphens. Field names have to be java compatible.
This should now be fixed in CVS. At the same time, I changed the
convention for name "mangling" - i.e. how Scheme names are mapped into
Java names. Now, if a Scheme name is a valid Java name it is used as
is; otherwise a reversible mangling using "$" characters is used.
Thus the Scheme names '< and '$Leq are both mapped into the same Java
name "$Leq". However, other names not containing "$" should no longer
clash, including pairs like "char-letter?" and "charLetter?" and
"isCharLetter" which used to be all mapped to "isCharLetter". Now
only names containing "$" can be ambiguous.
> 2. If for-each is used inside a method class fields are not accessible. I
> haven't tried it but I would guess that no lambda form enclosed inside a
> method would have access to the outer class closure. I solved my immediate
> problem by converting the for-each form to a do form.
Actually, it is supposed to work, and I don't know offhand why it
doesn't. May be some simple litle bug. If you write up a little test
case, perferably in a format suitable for adding to obj-test.scm, then
maybe I can take a look - when I have time for it!
Note that for-each using a lambda expression will often inline the for-each,
which may or may not be related to the bug. I.e. ideally we want two
test cases: One simple one where the lambda can get inlined; one where
the lambda cannot be inlined. (One way to prevent inlining is to
pass the lambda function to some identity function.)
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/