X10 supports generic class (see Section 8.1.2, class declaration syntax), and generic method definitions (Sec 8.4).
In brief, classes may be specified with type parameters, e.g. class Cell[T] { val item:T; def this(t:T) { this.item=t;} } New instances can be created thus: new Cell[Int](3); Methods may also be specified with type parameters: class A { static def id[T](t:T)=t; } and used thus: A.id(3); A limitation of the current release is that generic instancemethods are not yet suported, see XTENLANG-1191. On the native backend generic class definitions are translated into use of C++ templates. On 2/17/2011 6:33 PM, Aditya Sriram M wrote: > Hi X10 Team, > > > > I do not find X10 using templates in any of the docs > (http://dist.codehaus.org/x10/documentation/languagespec/x10-latest.pdf) or > any of the sample codes!! > > Isn't that required for X10? Have you temporarily postponed supporting it? > > > > Pls clarify.. > > > > Thanks and Regards, > > ? Aditya Sriram Mattaparthi, M.Tech > > . International Institute of Information Technology, > > . Electronic City, Bangalore - 560 100. > > * aditya.mattapar...@iiitb.org > > > > > > > > ------------------------------------------------------------------------------ > The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: > Pinpoint memory and threading errors before they happen. > Find and fix more than 250 security defects in the development cycle. > Locate bottlenecks in serial and parallel code that limit performance. > http://p.sf.net/sfu/intel-dev2devfeb > _______________________________________________ > X10-users mailing list > X10-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/x10-users > > > ------------------------------------------------------------------------------ The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE: Pinpoint memory and threading errors before they happen. Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance. http://p.sf.net/sfu/intel-dev2devfeb _______________________________________________ X10-users mailing list X10-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/x10-users