On 5/1/07, skaller <[EMAIL PROTECTED]> wrote: > ** In the end, i hope to merge classes, typeclasses > and modules into a single 'class' construction.
Yay! > 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. Hm, I had thought about this once too, but thought instead of adding immutable values to typeclasses... the functions associated with typeclasses are immutable so it doesn't seem consistent to me that variables should be. Immutable values would be useful for e.g. constants in numerical classes. IMHO things like array length or other "instance variables" should be associated with the value itself, e.g.: typeclass Array[t] { val len: t -> int; .. } This is no different than most OO schemes. Is there something I'm missing that makes mutable typeclass variables more expressive than "get/set"-style functions? - Chris ------------------------------------------------------------------------- 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