Thanks a lot for all the explanations on my error messages. The web page http://docs.codehaus.org/display/XTENLANG/Porting+from+X10+1.7+to+X10+2.0, in particular was very helpfull. There is a small typo in the line
val myArray : Array[SomeOtherClass{self.at(this)]; Is it val myArray : Array[SomeOtherClass{self.at(this)}]; or val myArray : Array[SomeOtherClass]{self.at(this)}; ? Also the equality test between strings seems to be different from 1.7.6 to svn The little test here behaves differently : import x10.io.Console; public class test3 { public static def main(args : Rail[String]) { val key = "this is a test"; Console.OUT.println("key = " + key); if (key.substring(0,4) == "that") Console.OUT.println("not ok"); if (key.substring(0,4) == "this") Console.OUT.println("ok1"); } } Best Regards, Marc ------------------------------------------------------------------------------------ Marc Tajchman Laboratoire de Génie Logiciel et de Simulation Software Engineering and Computer Simulation Laboratory CEA-DEN/DANS/DM2S/SFME/LGLS Tél : +33/1 69 08 73 27 Fax : +33/1 69 08 52 42 mailto:marc.tajch...@cea.fr ------------------------------------------------------------------------------------ Ce message électronique et tous les fichiers attachés qu'il contient sont confidentiels et destinés exclusivement à l'usage de la personne à laquelle ils sont adressés. Si vous avez reçu ce message par erreur, merci d'en avertir immédiatement son émetteur et de ne pas en conserver de copie. This e-mail and any files transmitted with it are confidential and intended solely for the use of the individual to whom they are addressed. If you have received this e-mail in error please inform the sender immediately, without keeping any copy thereof. -------- Message d'origine-------- De: Josh Milthorpe [mailto:josh.miltho...@anu.edu.au] Date: mer. 28/10/2009 04:13 À: TAJCHMAN Marc Cc: x10-users@lists.sourceforge.net Objet : Re: [X10-users] Meaning of some error messages Hi Marc, we're preparing a brief guide to porting X10 applications from v1.7 to v2.0. Please take a look and let me know if it's helpful - and feel free to contribute! http://docs.codehaus.org/display/XTENLANG/Porting+from+X10+1.7+to+X10+2.0 Cheers, Josh Igor Peshansky wrote: > "TAJCHMAN Marc" <marc.tajch...@cea.fr> wrote on 10/27/2009 06:10:18 PM: > > >> Hi, >> >> The following code compiles and runs with x10 1.7.6 : >> >> // laplacian.x10 >> import params; >> >> public class laplacian { >> >> var p:params = new params(); >> >> def this(args : Rail[String]) { >> p.parse(args); >> } >> >> public static def main(args : Rail[String]) { >> var l:laplacian = new laplacian(args); >> } >> } >> >> // params.x10 >> public class params { >> >> var n:Rail[int] = Rail.makeVar[int](3); >> >> def parse(args : Rail[String]) >> { >> n(0) = int.parseInt(args(0)); >> n(1) = int.parseInt(args(1)); >> n(2) = int.parseInt(args(2)); >> } >> }; >> >> When I try to compile it using svn r11743 (to test the x10mpi >> runtime), there are 2 kinds of error messages : >> >> >>> laplacian.x10:8: Cannot read fields of the proto value proto >>> > laplacian.this > >>> params.x10:7: Place type error: method target args cannot be >>> >> determined to be at x10.lang.Place.x10.lang.Place#FIRST_PLACE{} >> >> The second one can be removed by adding a "!" near the end of line 5 >> in params.x10. >> But I cannot find a solution to the other error. >> >> What is the meaning of these messages ? >> > > Hi, Marc, > > The first message says that you cannot read fields of an object that is > not > fully initialized (i.e., whose constructor has not completed, a.k.a. proto > object). The way to fix it in your code is to change the constructor of > laplacian as follows: > > def this(args : Rail[String]) { > val p_ = new params(); > p_.parse(args); > this.p = p_; > } > > The second message means that you're trying to invoke a non-global method > (namely, apply()) on an object that is not statically known to be local to > the place where you're invoking the method. You have to assert that it > is, > by adding "!" after the type. > > Hope this helps, > Igor > ------------------------------------------------------------------------------ Come build with us! The BlackBerry(R) Developer Conference in SF, CA is the only developer event you need to attend this year. Jumpstart your developing skills, take BlackBerry mobile applications to market and stay ahead of the curve. Join us from November 9 - 12, 2009. Register now! http://p.sf.net/sfu/devconference _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users