Hello ,
   I'm trying to implement a simple class factory-like behavior using a 
generic function with a type argument. Something like

proc factory(type t){
   var x : t;
   x = new t() ;      // This won't work
   result = x.bar()
   delete x;
   return result;
}

new expects an identifier that represents a class name, and of course 
will not work when given a type variable.

I suspect that this functionality (or something equivalent) is not 
possible using Chapel's current definition, but I wanted to double check 
in case I missed something in the documentation.


Thanks
Wael

-- 
Wael R. Elwasif
Computer Science Research Group
Oak Ridge National Laboratory


------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Chapel-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-users

Reply via email to