Browse thread
strange behavior with record type definition
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | skaller <skaller@u...> |
| Subject: | Re: [Caml-list] strange behavior with record type definition |
On Sat, 2005-11-12 at 21:20 +0900, Nicolas Cannasse wrote:
> >>Mmhh, why do we have to use differents label names in distinct record
> >>types ?
> >
> >
> > So that the type of an expression:
> >
> > { x = 1; y = 2 }
> >
> > can be determined.
>
> It could still be determined using all the labels together instead of
> the first one only, but that will not go well with the { r with ... }
> construct.
Hmmm .. but that must have the type of r, so if you had
a 'multi-label' solution this would be quite nice, since
it would help constrain the type of r.
In a whole program analyser this would always be enough:
if there is any doubt due to some unused fields, then those
fields would just be dropped since they're not used .. :)
[Felix will do this for classes, not so much by design
as because that's how the instantiator works ..]
--
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net