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
[Caml-list] Large projects in OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-05-20 (16:23)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] Large projects in OCaml
On Thu, 2004-05-20 at 23:10, Jon Harrop wrote:
> On Thursday 20 May 2004 09:46, skaller wrote:
> > ...
> > I have found several bugs in the core compiler.

> Just out of curiosity, what were these bugs?

Typing of polymorphic variants. The big one
caused a core dump, rending 3.05 and 3.06 unusable.

I also pointed at a detail of pattern matching
polymorphic variants leading in part to recent
changes where the more relaxed rules can occasionally
lead to some indeterminism (there's an article
by Jacques Garrique on this somewhere). I wouldn't
call that a bug, but the new pattern matches are
less fragile: basically, the old ones refused
to allow redundant or useless cases (involving guards)
because it confused the typing. The problem was if you
commented out a tag somewhere else it gratuitously
broke the match typing, and you'd have to comment
out the case in the match too (even when all you'd
done is restrict the input expression tag set).
Now, there's a risk that guarded patterns aren't
tested sequentially, so you might end up in an
unexpected match handler if you weren't aware
of this (you can always nest matches to restore
the determinism). At least I think that's it :)

Polymorphic variants involve some interesting
language design compromises!

John Skaller, mailto:skaller@users.sf.net
voice: 061-2-9660-0850, 
snail: PO BOX 401 Glebe NSW 2037 Australia
Checkout the Felix programming language http://felix.sf.net

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners