On Tue, 2007-05-01 at 12:14 -0700, Erick Tryzelaar wrote: > skaller wrote: > > should work. Or perhaps: > > > > const inf: double = "1.0/0.0"; > > I'd prefer that. I wish we could do this, but it doesn't compile because > of the "virtual const".
That's a bug. I tried to make it work, but i got those annoying vs/ts mismatch errors .. should make a ticket for this ** You can use a fun tho: virtual fun inf: 1 -> T; fun inf: 1 -> float = "1.0f/0.0f"; but you would have to write inf() to use it. ** In the end, i hope to merge classes, typeclasses and modules into a single 'class' construction. typeclasses with variables (not just type variables) make sense .. the functions are just methods and the variables live in an dynamically created object. Woops.. that's just OO! And also .. it's dependent typing! For example typeclass Array[t] { val len: int; .. } would make 'len' the dynamic length of the array. > >> I could see it useful to be able to have a numeric_limits-like typeclass > >> to provide this kind of metadata about types. > > > > C++ numeric limits are singularly useless because they can't > > be accessed during pre-processing .. which is where they're > > usually needed. C macros don't have this problem .. and > > are available at run time too. > > We can't do that yet, right? That would require something like MetaOCaml? Yes, or dependent typing. -- John Skaller <skaller at users dot sf dot net> Felix, successor to C++: http://felix.sf.net ------------------------------------------------------------------------- This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ Felix-language mailing list Felix-language@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/felix-language