Christoph Pospiech <christoph.pospi...@de.ibm.com> wrote on 06/01/2010
01:51:08 AM:
>
> This brings me to a question of more philosophical or aesthetic nature.
>
> Why is it
> val v_rail:Rail[double] =
>        Rail.make[double](n, (i:Int) => {(i*1.0) as double});
> but
> val v:Array[double] =
>       new Array[double](n, (i:Int) => {(i*1.0) as double});
> ?
>
> I would have expected that for every X10 class I could use "new
<class_name>"
> which internally may call "make.<classname>".
>

This is an implementation flaw leaking through to the API.  Rail (and
ValRail) are @NativeRep classes with generic type parameters.  The compiler
doesn't properly handle constructors for such classes, so we have to use a
static make method to hack around the compiler bug.  The goal is to make
Rail and ValRail disappear as user visible classes (ie, they will be
typedefs for Array(1)/ValArray(1)) at which point this wart will also go
away.

--dave
------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
X10-users mailing list
X10-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/x10-users

Reply via email to