<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2002/07/2bd49e9e3d2bfef1b3b0efd6d37d8010"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2002-07-14T09:39:06"
  subject="Re: [Caml-list] Five Questions about Objects"
  prev="2002/07/88ceff20a8333237e0473e41d8ebf755"
  next="2002/07/24c7f16d5a51f9a5aa0cba0215942f83"
  prev-in-thread="2002/07/88ceff20a8333237e0473e41d8ebf755"
  next-in-thread="2002/07/7e73c73d2257ab2c68a534ee7340330c"
  prev-thread="2002/07/e2f2b258abd0d3497431776b34442703"
  next-thread="2002/07/5a07099df93b470f2f48a69d7d4bf4a2"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Five Questions about Objects">
<msg 
  url="2002/07/159ef0ccc84f7c657489db370903e327"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-07-13T13:40:58"
  subject="[Caml-list] Five Questions about Objects">
<msg 
  url="2002/07/e609d5c80b3292d73cadaef94b22faa1"
  from="YAMAGATA yoriyuki &lt;yoriyuki@m...&gt;"
  author="YAMAGATA yoriyuki"
  date="2002-07-14T02:01:08"
  subject="Re: [Caml-list] Five Questions about Objects">
<msg 
  url="2002/07/88ceff20a8333237e0473e41d8ebf755"
  from="Alain Frisch &lt;frisch@c...&gt;"
  author="Alain Frisch"
  date="2002-07-14T08:58:25"
  subject="Re: [Caml-list] Five Questions about Objects">
<msg 
  url="2002/07/2bd49e9e3d2bfef1b3b0efd6d37d8010"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2002-07-14T09:39:06"
  subject="Re: [Caml-list] Five Questions about Objects">
<msg 
  url="2002/07/7e73c73d2257ab2c68a534ee7340330c"
  from="William Lovas &lt;wlovas@s...&gt;"
  author="William Lovas"
  date="2002-07-14T10:24:02"
  subject="Re: [Caml-list] Five Questions about Objects">
</msg>
</msg>
</msg>
<msg 
  url="2002/07/8e7888e28c1b918c84298e36bdfb197e"
  from="Brian Smith &lt;blsmith@b...&gt;"
  author="Brian Smith"
  date="2002-07-20T12:56:50"
  subject="Re: [Caml-list] Five Questions about Objects">
<msg 
  url="2002/07/4a6d6ba66cbaf5fd1eb212e448adcbb0"
  from="YAMAGATA yoriyuki &lt;yoriyuki@m...&gt;"
  author="YAMAGATA yoriyuki"
  date="2002-07-20T15:49:38"
  subject="Re: [Caml-list] Five Questions about Objects">
</msg>
</msg>
</msg>
<msg 
  url="2002/07/75378d984912d08869be7863a3be88c1"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2002-07-14T03:32:58"
  subject="Re: [Caml-list] Five Questions about Objects">
</msg>
<msg 
  url="2002/07/f19d29f39c16d741976445296fba36ea"
  from="Xavier Leroy &lt;xavier.leroy@i...&gt;"
  author="Xavier Leroy"
  date="2002-07-14T20:08:40"
  subject="Re: [Caml-list] Five Questions about Objects">
<msg 
  url="2002/07/2737a7cea2fd0851c3767abc9726e20b"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-07-16T04:48:45"
  subject="Re: [Caml-list] Five Questions about Objects">
</msg>
<msg 
  url="2002/07/f178655b06c3af22c50aee33163cd56f"
  from="Oleg &lt;oleg_inconnu@m...&gt;"
  author="Oleg"
  date="2002-07-16T04:48:07"
  subject="Re: [Caml-list] Five Questions about Objects">
</msg>
</msg>
</msg>
</thread>

<contents>
From: Alain Frisch &lt;frisch@clipper.ens.fr&gt;
&gt; On Sun, 14 Jul 2002, YAMAGATA yoriyuki wrote:
&gt; 
&gt; &gt; However, I wonder why a class is necessary in the first place.  I'm
&gt; &gt; not familiar with the theory of OOP, but I feel like direct creation
&gt; &gt; of objects is possible in functional languages.
&gt; 
&gt; It is already possible in OCaml, thanks to local modules:
&gt; 
&gt; "object ... end"
&gt; ===&gt;
&gt; let module M = struct class o = object ... end end in new M.o
&gt; 
&gt; 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

</contents>

</message>

