Re: Tuples, Generics, and compiler bugs, oh my!

Tom Kaitchuck <[email protected]> Sun, 17 Jul 2005 00:46:24 -0700
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
On Monday 11 July 2005 2:03 am, Daniel Bonniot wrote:
> > Ok, I'm using the following:
> >
> > String toString( (int t, int u))
> > {
> >
> >   return "HELLO: (" + t.toString() + "," + u.toString() + ")";
> > }
> >
> > <T,U> String toString(( T t, U u )) = "(" t "," u ")";
> >
> > void main(String[] args)
> > {
> >   int a = 1;
> >   int b = 2;
> >   println((a,b).toString());
> > }
> >
> > and that prints:
> > [I@df6ccd
>
> Are you sure you recompiled before running? I just tried it, and I get the
> expected output:
> HELLO: (1,2)

I still get the same output, I have tried a few things but nothing seems to 
work... I am running Mandrake with:
Nice-0.9.11-1
j2re-1.4.2_07-1mdk
Both installed from RPMs.

I looked briefly at the compiler code, and frankly I'm not sure why toString() 
would ever print something like that, as it appears there is a toString 
method already defined... Perhaps I am looking at something else.

> > Yes I was using 0.9.10 which I believed to be current, as it is still
> > linked to from the installation page for the rpm, even though 0.9.11 is
> > on sourceforge.
>
> Right, my mistake.

This is still not fixed.


I am using porting some java code and I notice that for the most part simple 
pieces of code can brought over by simply changing the file extension and the 
imports. However there are a number of keywords that still cause the compiler 
to trigger an error. I realize this is because some of them are not 
implemented yet. However I want to make sure that full compatibility in this 
way is a goal. If not, would it be possible to allow mixing and matching by 
placing java files in the same package with nice files, and having the 
compiler work it all out automatically?


-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click