This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: CNI array syntax
- To: Bryce McKinlay <bryce at albatross dot co dot nz>
- Subject: Re: CNI array syntax
- From: Tom Tromey <tromey at redhat dot com>
- Date: 03 Apr 2001 11:47:58 -0600
- Cc: java at gcc dot gnu dot org
- References: <3AC2C8CC.990657C1@albatross.co.nz>
- Reply-To: tromey at redhat dot com
>>>>> "Bryce" == Bryce McKinlay <bryce@albatross.co.nz> writes:
Bryce> Has a more natural syntax for creating java arrays from CNI
Bryce> ever been considered?
I haven't. I don't think there's been a whole lot of thought about
how to evolve CNI.
Bryce> Today I wanted to do the equivilant of "new java.io.File[1]" in
Bryce> C++. The code for this (afaik) is quite ugly:
Bryce> myfile = reinterpret_cast <JArray< ::java::io::File *>*>
Bryce> (JvNewObjectArray (1, &java::io::File::class$, f));
Bryce> But it should be able to be much more cleanly expressed as:
Bryce> myfile = new JArray<java::io::File *> (1);
Could you do this by adding `operator new' to JArray? Maybe that
could encapsulate the ugliness without requiring a hack to g++.
Tom