* file name of java class generated by kawa
@ 2015-09-17 9:25 Damien Mattei
2015-09-17 10:19 ` Per Bothner
0 siblings, 1 reply; 3+ messages in thread
From: Damien Mattei @ 2015-09-17 9:25 UTC (permalink / raw)
To: kawa
hello,
i'm newbie to kawa ,nor scheme,nor java, i had compiled the kawa example
point 2D class
( http://www.gnu.org/software/kawa/Defining-new-classes.html )
i put the example in a file named 2d-vector.scm
and compiled it with the command :
java -jar /usr/local/lib/kawa-2.0.jar -C 2d-vector.scm
and i get those file as result ,files that seems ok for use with other
classes but i'm surprised of the names that begin with $ character:
$N2d$Mnvector.class
is it a convention ? it's not really pretty ... is there a way to have
just a 2d-vector.class file name?
what is the use of the other generated file:
$N2d$Mnvector$frame.class
Regards,
Damien
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: file name of java class generated by kawa
2015-09-17 9:25 file name of java class generated by kawa Damien Mattei
@ 2015-09-17 10:19 ` Per Bothner
2015-09-17 13:00 ` Damien Mattei
0 siblings, 1 reply; 3+ messages in thread
From: Per Bothner @ 2015-09-17 10:19 UTC (permalink / raw)
To: kawa, Damien Mattei
On 09/17/2015 02:25 AM, Damien Mattei wrote:
> i put the example in a file named 2d-vector.scm
>
> and compiled it with the command :
>
> java -jar /usr/local/lib/kawa-2.0.jar -C 2d-vector.scm
>
> and i get those file as result ,files that seems ok for use with other
> classes but i'm surprised of the names that begin with $ character:
>
> $N2d$Mnvector.class
>
> is it a convention ? it's not really pretty ... is there a way to have
> just a 2d-vector.class file name?
This is an issue I agonize over. "2d-vector" is valid class name for
the virtual machine, but it is not a valid *Java* class name. Thus
if we created the class "2d-vector" there would be no way to reference
the class from Java code except by using reflection.
The question is which is more important:
(a) a clean translation from Scheme name to class name?
(b) being able to access the class from Java without reflection?
I don't know the right answer. So I've stuck with the status quo,
inherited from Old Days when the restrictions on class names were stricter.
For an in-depth-disussion see:
https://blogs.oracle.com/jrose/entry/symbolic_freedom_in_the_vm
> what is the use of the other generated file:
>
> $N2d$Mnvector$frame.class
$frame classes are used for implementing closures, basically.
In the 2d-vector class it turns out it isn't really needed,
so generating it may be a bug, but there are other cases it s needed.
The "invoke" branch (in Subversion) of Kawa implements closures
differently (using MethodHandles on Java 7 or newer), and
that dos not create the $N2d$Mnvector$frame class.
--
--Per Bothner
per@bothner.com http://per.bothner.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: file name of java class generated by kawa
2015-09-17 10:19 ` Per Bothner
@ 2015-09-17 13:00 ` Damien Mattei
0 siblings, 0 replies; 3+ messages in thread
From: Damien Mattei @ 2015-09-17 13:00 UTC (permalink / raw)
To: Per Bothner, kawa
thanks for your response...
i simply change the class name in Vector2D and i get a smart
Vector2D.class
that is more human freindly.
see my next questions in a few minutes ;-)
Damien
Le 17/09/2015 12:18, Per Bothner a écrit :
>
>
> On 09/17/2015 02:25 AM, Damien Mattei wrote:
>> i put the example in a file named 2d-vector.scm
>>
>> and compiled it with the command :
>>
>> java -jar /usr/local/lib/kawa-2.0.jar -C 2d-vector.scm
>>
>> and i get those file as result ,files that seems ok for use with other
>> classes but i'm surprised of the names that begin with $ character:
>>
>> $N2d$Mnvector.class
>>
>> is it a convention ? it's not really pretty ... is there a way to have
>> just a 2d-vector.class file name?
>
> This is an issue I agonize over. "2d-vector" is valid class name for
> the virtual machine, but it is not a valid *Java* class name. Thus
> if we created the class "2d-vector" there would be no way to reference
> the class from Java code except by using reflection.
>
> The question is which is more important:
> (a) a clean translation from Scheme name to class name?
> (b) being able to access the class from Java without reflection?
>
> I don't know the right answer. So I've stuck with the status quo,
> inherited from Old Days when the restrictions on class names were
> stricter.
>
> For an in-depth-disussion see:
> https://blogs.oracle.com/jrose/entry/symbolic_freedom_in_the_vm
>
>> what is the use of the other generated file:
>>
>> $N2d$Mnvector$frame.class
>
> $frame classes are used for implementing closures, basically.
> In the 2d-vector class it turns out it isn't really needed,
> so generating it may be a bug, but there are other cases it s needed.
>
> The "invoke" branch (in Subversion) of Kawa implements closures
> differently (using MethodHandles on Java 7 or newer), and
> that dos not create the $N2d$Mnvector$frame class.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2015-09-17 13:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-09-17 9:25 file name of java class generated by kawa Damien Mattei
2015-09-17 10:19 ` Per Bothner
2015-09-17 13:00 ` Damien Mattei
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).