A minor problem I ran into while playing around with the testing of the 
stdlib. I'd like to be able to insert debugging code into a pattern 
match, but in order to do that, I have to make everything into an 
anonymous function. I wish I could do something like this:

fun map[T,U] (f:T->U) (x:list[T]) =>
  match x with
  | Empty[T] => Empty[U]
  | Cons(?h, ?t) =>
      print "hello"; endl;
      Cons(_f h, map f x)
  endmatch
;


We talked about something like this about a month ago, but I never 
thought about using it like this. I have no idea if this is possible, 
but it seems like it could be, since there's some clear terminals for 
this expression: the "|" and the "endmatch".  Can the LALR parser handle 
this, and would it really complicate the parser to allow the semi-colon 
to act as a multiple statements->expression meta-function inside an 
expression?

So, in summation, someone please tell me why this is a bad idea :)

-e

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to