> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] On
> Behalf Of Erick Tryzelaar
> Sent: Thu 05 October 2006 1:41 PM
> To: felix-language
> Subject: [Felix-language] converting statements into expressions
>
> 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
> ;
>
Can't you do this?
fun map[T,U] (f:T->U) (x:list[T]) =>
match x with
| Empty[T] => Empty[U]
| Cons(?h, ?t) => {
print "hello"; endl;
return Cons(_f h, map f x)
}
endmatch
;
Jonathan.
<snip>
---------------------------------------------------------------------
CAUTION: The information contained in this e-mail is confidential and
may be legally privileged. If the reader of this message is not the
intended recipient you are hereby notified that any use,
dissemination, distribution, or reproduction of this message is
prohibited. If you have received this message in error please forward
this message to [EMAIL PROTECTED] and delete all copies
of this message.
If you wish to have us block your email address from receiving any
future emails from this organisation please forward this email with
your request to [EMAIL PROTECTED]
You can also contact the Lion Nathan company responsible for sending
this message by calling our IT helpdesk on +61 1300 300320
or you can reply directly by email to the sender above. Thank you.
---------------------------------------------------------------------
-------------------------------------------------------------------------
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