Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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 <garrigue@kurims.kyoto-u.ac.jp> 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
as:

	(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 caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners