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
Undecidability of OCaml type checking
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 1999-07-14 (16:32)
From: Xavier Leroy <Xavier.Leroy@i...>
Subject: Re: irritability of structure name conflicts
> I didn't get the error before I added the field type!  I'm (a)
> confused, and (b) irritated that I have to keep making up names for
> labels!

I agree it's an unpleasant feature of Caml, caused by the way we do
type inference on record accesses.  E.g. if a label "lbl" could belong
to two named record types t1 and t2, "fun x -> x.lbl" would have
two types "t1 -> ..." and "t2 -> ..."

> Is there some way I can force it to interpret the type constructor as
> a particular type so that it chooses the labels from the correct set?

Currently no, but we discussed several possible approaches on this
list a while ago.  If you're interested, you can search the archives
at http://caml.inria.fr/.  (The subject line was "CamlIDL - stub code
generator and COM binding for OCaml".)


- Xavier Leroy