On Thu, 2007-03-29 at 01:51 +0200, Klas Ivarsson wrote: > > Hi all! > > I've been testing the new varray a little, > by making a very basic vector implementation. > You can find the code below. > > A few questions showed up during the hacking... > > In std.flx you find: > fun subscript[t]: varray[t] * !ints -> lvalue[t] = "$1[$2]"; > What does !ints mean?
ints is a set of all the integer types, using the !ints notation is shorthand for: fun subscript[t,u in ints]: varray[t] * u -> lvalue[t] = "$1[$2]"; > Is there a way to put string or bool in a varray? Sure: s.[t]="hello"; Note that 'subscript' maps to .[] notation, and the result is an lvalue so you can assign to it. Just don't assign off the end of the array .. it isn't safe. > // The two rows below are not allowed ???? > //var bool_vector <- new Felix_Vector::flxVec[bool](4ul); > //var string_vector <- new Felix_Vector::flxVec[string](4ul); They should be .. -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys-and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language