Hello,

I'm getting started with X10 and am a bit stuck with the handling of  
Rails (I think I might get the same problem with Arrays and so on).

Let's say I create the following:

         val bla = new Rail[Long](10);
         bla(0) = 2343;
         bla(1) = 4534;
         bla(2) = 3424;
         for(i in 0..9)
             bla(i)=42;
         Console.OUT.print("Content: ");
         Console.OUT.println(bla);

I get 42 ten times as an output.
My first question: At least the first three values of my Rail are set.  
As far as I understood "val" makes them become immutable. So why can I  
turn them all into 42?

My second question: If I change the for-loop into

         for(b in bla)
             b=42;

I get the expected error message by the compiler though it's actually  
no formal change. Or is there any?

bye
Michael


------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to