caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Vasile Rotaru <vrotaru@seznam.cz>
To: Ocaml Mailing List <caml-list@inria.fr>
Subject: Re: [Caml-list] subtyping, polymorphism, higher order types.....
Date: Sat, 5 Jul 2003 17:07:06 +0200	[thread overview]
Message-ID: <20030705170706.1accb8aa.vrotaru@seznam.cz> (raw)
In-Reply-To: <20030705112126Q.garrigue@kurims.kyoto-u.ac.jp>

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


      parent reply	other threads:[~2003-07-05 15:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-03 14:33 Shaddin Doghmi
2003-07-03 16:23 ` brogoff
2003-07-04  6:43 ` Daniel Weil
2003-07-04 20:45 ` Vasile Rotaru
2003-07-05  2:21   ` Jacques Garrigue
2003-07-05  7:46     ` Fernando Alegre
2003-07-05 15:07     ` Vasile Rotaru [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030705170706.1accb8aa.vrotaru@seznam.cz \
    --to=vrotaru@seznam.cz \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).