English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
anonymous function + lable bug?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2000-11-08 (17:31)
From: Chris Hecker <checker@d...>
Subject: Re: anonymous function + lable bug?

>> I thought these two were equivalent?
>They are not:

Right, I didn't mean to say they're completely equivalent (I've read the FAQ), just that I expected equivalence in that case.

>It would be possible to add special rules to allow
>        function ~l:p1 -> e1 | ... | ~l:pn -> en

Ah, now I see, it's because the parameter in function is actually the pattern in an implicit match?

Is there ever a reason to use function (assuming you don't mind parenthesizing constructors and whatnot in fun arguments)?  Does the implied match allow some simplification or optimization or something?  Why do they both exist?

As I said, I've read the FAQ, but I can't see why you'd ever use function when you've got fun...