Version française
Home     About     Download     Resources     Contact us    
Browse thread
strange behavior with record type definition
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Florent <florentflament@a...>
Subject: Re: [Caml-list] strange behavior with record type definition
Thanks for your responses ,

Well, this is not an usual behavior for records, but why not.
If this choice has been made by the ocaml team, I'll use different label 
names for my records.

florent



Jacques Garrigue wrote:

>It is not a question about it being possible or not (it is possible,
>and can even be made "principal"), but whether we want it in the
>language or not.
>Essentially, ocaml has two kinds of records: explicitly
>declared records, and objects. Of course, objects as records
>are not very efficient, but in many cases this doesn't matter.
>You can even find a syntax extension to do it with the same syntax as
>records.
>  http://www.math.nagoya-u.ac.jp/~garrigue/code/ocaml.html
>
>Knowing this, the choice is currently to make explicit records
>non-ambiguous. This way you just have to look at any of the the
>labels to know exactly which type is involved. This could be changed,
>but you would loose this property.  Which would be fine with me, as
>long as the information is still still easy to deduce without relying
>on type inference.
>
>Jacques Garrigue
>  
>