does nice have separate compilation, or does it effectively "compile" a whole program at a time?

Isaac Gouy <[email protected]> Wed, 15 Jun 2005 08:51:33 -0700 (PDT)
Newsgroups gmane.comp.lang.nice.general
Message-ID <[email protected]>
From a newsgroup discussion
http://groups-beta.google.com/group/comp.object/messages/4c3dfd2db7c5fea8,6f644cdbdecb5407,950b427b7bb023eb,b8ed3c2e26d02cde,c779cd31fff8059c,34a59551a8ab7bed,0dcd8708d34bb651,bfdb8df788bc34b5,2715562eaf12ffbe,dcebd9b34ce1391b?hl=en&thread_id=670d45fe65a2c623&mode=thread&noheader=1&_done=%2Fgroup%2Fcomp.object%2Fbrowse_frm%2Fthread%2F670d45fe65a2c623%2F0dcd8708d34bb651%3Fhl%3Den%26#doc_4c3dfd2db7c5fea8

Does nice have separate compilation, or does it effectively  "compile"
a whole program at a time? 


package test.shape;
abstract class Shape {}
void intersect(Shape s1, Shape s2);


package test.circle;
import test.shape;
class Circle extends Shape {}
intersect(Circle s1, Circle s2){}


package test.rectangle;
import test.shape;
class Rectangle extends Shape {}
intersect(Rectangle s1, Rectangle s2){}


package test.intersect;
import test.shape;
import test.circle;
import test.rectangle;
intersect(Circle s1, Rectangle s2){ println("circle rectangle"); }
intersect(Rectangle s1, Circle s2){ println("rectangle circle"); }


package test.hoop;
import test.shape;
void testIntersect(Shape s1, Shape s2){ s1.intersect(s2); }


package test;
import test.shape;
import test.rectangle;
import test.circle;
import test.intersect;
import test.hoop;

void main(String[] args){
   let r = new Rectangle();
   let c = new Circle();

   testIntersect(c,r);
   testIntersect(c,c);
   testIntersect(r,c);
   testIntersect(r,r);  
}


Nice compiler version 0.9.11 (build 2005.06.09, 04:36:48 UTC)

1) I:\Nice\Test>nicec --sourcepath .. --classpath .. -a test.jar test
compiles OK

2) hide shape.nice, circle.nice, intersect.nice, hoop.nice

3) retract intersect implementation in rectangle.nice 
//intersect(Rectangle s1, Rectangle s2){}

4) I:\Nice\Test>nicec --sourcepath .. --classpath .. -a test.jar test
nice.lang: parsing
test.shape: parsing
test.rectangle: parsing
test.circle: parsing
test.intersect: parsing

I:\Nice\test\package.nicei: line 6, column 8:
test.intersect must be compiled, but no source code is available.
The source path is: ..
compilation failed with 1 error




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 


-------------------------------------------------------
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