Re: irritability of structure name conflicts

From: Xavier Leroy (Xavier.Leroy@inria.fr)
Date: Wed Jul 14 1999 - 17:43:03 MET DST


Date: Wed, 14 Jul 1999 17:43:03 +0200
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Dave Mason <dmason@sarg.Ryerson.CA>, caml-list@inria.fr
Subject: Re: irritability of structure name conflicts
In-Reply-To: <199907131759.NAA00710@sarg.Ryerson.CA>; from Dave Mason on Tue, Jul 13, 1999 at 01:59:44PM -0400

> 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/pub/old_caml_site/. (The subject line was "CamlIDL - stub code
generator and COM binding for OCaml".)

Best,

- Xavier Leroy



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:23 MET