Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] subtyping, polymorphism, higher order types.....
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-07-05 (15:53)
From: Vasile Rotaru <vrotaru@s...>
Subject: Re: [Caml-list] subtyping, polymorphism, higher order types.....
On Sat, 05 Jul 2003 11:21:26 +0900
Jacques Garrigue <> wrote:

> > 
> >     type point = int * int * _ ;;
> > 
> > where the underscore stands for any sequences of types. Colour,
> > taste, strangeness, etc.
> This looks very much like an ocaml object type to me...
> Is the absence of labels for fields important?

  Nor, it is not. The labels are not at all important. The same scheme
will work for open/extensible records. (In fact, those are the records
which are extensible in Oberon.) I have just run once the "ocamlc"
compiler with the "-dlambda" option, and I was pleasantly surprised to
see that access to components of a type is coded to something as simple

	(field 0 param/57)
        (field 1 param/57)

and so on. But this means that any function which works with "point"-s
(from my previous message) will work work correctly "color_point"-s, if
it were allowed to. Correct me if I'm wrong, but the objects have a
higher overhead. Besides -- I'm subjective, of course -- this scheme has
some kind of "math appeal" to me.

  I know that there is and will always be a tradeoff between
expressiveness of a language and its complexity, so don't take that
proposal, for more than it is. Just a few thoughts. 

Vasile Rotaru

It is easy to find fault, if one has that disposition.  There was once a man
who, not being able to find any other fault with his coal, complained that
there were too many prehistoric toads in it.
		-- Mark Twain, "Pudd'nhead Wilson's Calendar"

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: