Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: [Caml-list] Feature request : Tuples vs. records
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] Feature request : Tuples vs. records
On 2/23/07, Till Varoquaux <till.varoquaux@gmail.com> wrote:
> I also agree:
> IMHO , it woud feel natural to have
>  open .. in (* <-- there's already a camlp4 extension that brings this*)
>  type ... in
> etc...
> it would be coherent with the let syntax. However I don't know the
> deep implications of such a change and happen to be very prompt
> criticizing. I'm sure there is a profound reason for the language not
> be like this.

You already have it in some sense:

let module M = struct
  type t = ...
end in
   ... M.t ...

>
> Till
>
> On 2/23/07, Richard Jones <rich@annexia.org> wrote:
> > On Fri, Feb 23, 2007 at 10:39:45AM +0900, Jacques Garrigue wrote:
> > > On the other hand structural typing avoids extra definitions, and
> > > allows more code sharing and polymorphism. One cannot imagine ML
> > > without structural tuples. In ocaml, you have also objects that can
> > > mimic records, and polymorphic variants for sum types.
> >
> > The penalty of having the extra definitions wouldn't be so bad if
> > 'type t = ...' could appear inside let statements (ie. not just at the
> > top level).  At the moment, type definitions are often a long way away
> > from where they are used.
> >
> > Rich.
> >
> > --
> > Richard Jones
> > Red Hat UK Limited
> >
> > _______________________________________________
> > Caml-list mailing list. Subscription management:
> > http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> > Archives: http://caml.inria.fr
> > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> > Bug reports: http://caml.inria.fr/bin/caml-bugs
> >
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


-- 
Nicolas Pouillard