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

Reply via email to