humm.....

val test2 : Array[Place] = new Array[Place](host);

*does not* compile... actually.

I've tried this too:

for (host in Place.places()) {
     val test1 : Array[Place] = new Array[Place][host,host,host,host];
}

.. which leads me to think that:

1. I'm declaring an Array with parametric type Place  :: Array[Place]
2. I'm initializing this Array[Place] with 4 elements of value "host"

If I'm correct, the conclusion is that the syntax is pretty confused :(

Thanks

Richard Gomes
M: +44(77)9955-6813
http://tinyurl.com/frgomes
twitter: frgomes

JQuantLib is a library for Quantitative Finance written in Java.
http://www.jquantlib.org/
twitter: jquantlib

On 19/11/10 08:40, Richard Gomes wrote:
> Hi guys,
>
> I've seen code more or less like this:
>
>       for (host in Place.places()) {
>           val workers : Array[Place] = new Array[Place][host];
>       ...
>       }
>
> What it means, exactly?
> I'm confused with text "[host]" which looks strange.
>
>
> I've changed "[host]" by "(host)" like shown below and it compiles.
>
>       for (host in Place.places()) {
>           val test1 : Array[Place] = new Array[Place][host]; // compiles
>           val test2 : Array[Place] = new Array[Place](host); // compiles
>       ...
>       }
>
> So... looks like the compiler is automagically interpreting "[host]" as
> "(host)" ???
>
>
> Thanks a lot
>
> Cheers :)
>

------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1,  ECMAScript5, and DOM L2 & L3.
Spend less time writing and  rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to