<?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/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"
  prev="2002/07/1fb0f8b25431c34cda5504c7d6412968"
  next="2002/07/cc062fa54b78609497f3080c5331c9a1"
  prev-in-thread="2002/07/7e73c73d2257ab2c68a534ee7340330c"
  next-in-thread="2002/07/4a6d6ba66cbaf5fd1eb212e448adcbb0"
  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>
YAMAGATA yoriyuki wrote:
&gt; From: Oleg &lt;oleg_inconnu@myrealbox.com&gt;
&gt; Subject: [Caml-list] Five Questions about Objects
&gt; Date: Sat, 13 Jul 2002 09:42:47 -0400
&gt; 
&gt; 
&gt;&gt;let point a b = 
&gt;&gt;  object
&gt;&gt;    val x = a
&gt;&gt;    val y = b
&gt;&gt;    method get () = (x, y)
&gt;&gt;  end;;
&gt;&gt;
&gt; 
&gt; I think You can't do like this.  object ... end is a part of a class
&gt; definition, and not an ordinary expression.
&gt; 
&gt; However, I wonder why a class is necessary in the first place.  I'm
&gt; not familiar with the theory of OOP, but I feel like direct creation
&gt; of objects is possible in functional languages.

I think that the "class" and "class type" constructs are useful when 
expressing the relationship between types/classes. For example, "let 
point a b..." defines a function that creates an object. But, what does 
(x :&gt; point) mean when point is a function instead of a class type? If 
anything, I would thing that (f :&gt; g) would mean that the return type 
and parameter types of f follow the covariant/contravariant rules for 
methods. Similarly, what would the #point construct mean?

Also, class types are types, and classes define implicit types, so I 
think that the class syntax should be close to the syntax for defining 
other kinds of types, instead of the syntax for defining functions.

- Brian
-------------------
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>

