On Wed, 2007-04-11 at 10:25 -0700, Erick Tryzelaar wrote: > open List; > fun head[T] (Cons[T] (h, t)) => h; > > > I'd prefer not to have to have the '?', but if they're needed for > parsing, then oh well :)
you can do this now: fun head[T] : list[T] -> T = | Cons (?h,_) => h; The type must be given because constructors can be overloaded. The Empty case will result is an match failure. Ocaml uses Upper case vs. lower case where Felix uses ident vs. ?ident .. case rules aren't acceptable in a international language. This would be nice val a = 1; match x with | @a => .. which requires yet another marker to distinguish expressions, but it can be done now like: | ?x when x == a => and otherwise would need yet another special character. -- 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