caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: frisch@clipper.ens.fr
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Five Questions about Objects
Date: Sun, 14 Jul 2002 18:38:42 +0900	[thread overview]
Message-ID: <20020714183842E.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <Pine.SOL.4.44.0207141051270.8560-100000@clipper.ens.fr>

From: Alain Frisch <frisch@clipper.ens.fr>
> On Sun, 14 Jul 2002, YAMAGATA yoriyuki wrote:
> 
> > However, I wonder why a class is necessary in the first place.  I'm
> > not familiar with the theory of OOP, but I feel like direct creation
> > of objects is possible in functional languages.
> 
> It is already possible in OCaml, thanks to local modules:
> 
> "object ... end"
> ===>
> let module M = struct class o = object ... end end in new M.o
> 
> It would be straightforward to define a Camlp4 syntax extension for this.

This only works if your object has a monomorphic type.

The real point is that if object definitions were really first class
in the language, they would not be restricted by these strange
variable binding conditions: type inference would be enough.
Since there is no theoretical problem here, it may well be a useful
extension.

  Jacques Garrigue
-------------------
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


  reply	other threads:[~2002-07-14  9:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-13 13:42 Oleg
2002-07-14  0:58 ` YAMAGATA yoriyuki
2002-07-14  2:41   ` Brian Smith
2002-07-20 15:46     ` YAMAGATA yoriyuki
2002-07-14  8:58   ` Alain Frisch
2002-07-14  9:38     ` Jacques Garrigue [this message]
2002-07-14 10:23       ` William Lovas
2002-07-14  3:26 ` Jacques Garrigue
2002-07-14 15:47 ` Xavier Leroy
2002-07-16  4:48   ` Oleg
2002-07-16  4:49   ` Oleg

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=20020714183842E.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=frisch@clipper.ens.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).