<?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/dc0f73cee705120e47f611b302d2229c"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2002-07-16T01:15:48"
  subject="Re: [Caml-list] Recovering masked methods"
  prev="2002/07/ca2a3e0a12658384bdc94c4ad62eb59b"
  next="2002/07/732a42cc8a2fac38a48afc22b2ed4be4"
  prev-in-thread="2002/07/2fe55408b32aa0c8bbfe694c2fc4d83a"
  next-in-thread="2002/07/17972e65a4fa6e1be37544c22613850e"
  prev-thread="2002/07/f588263f2499215c76c4696e61086612"
  next-thread="2002/07/ca2a3e0a12658384bdc94c4ad62eb59b"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Recovering masked methods">
<msg 
  url="2002/07/2fe55408b32aa0c8bbfe694c2fc4d83a"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-15T23:06:46"
  subject="[Caml-list] Recovering masked methods">
<msg 
  url="2002/07/dc0f73cee705120e47f611b302d2229c"
  from="Jacques Garrigue &lt;garrigue@k...&gt;"
  author="Jacques Garrigue"
  date="2002-07-16T01:15:48"
  subject="Re: [Caml-list] Recovering masked methods">
<msg 
  url="2002/07/17972e65a4fa6e1be37544c22613850e"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-16T09:21:43"
  subject="Re: [Caml-list] Recovering masked methods">
<msg 
  url="2002/07/4bbe8c44332ba5a3150f66f671c75eaa"
  from="Laurent Vibert &lt;lvibert@i...&gt;"
  author="Laurent Vibert"
  date="2002-07-16T09:48:33"
  subject="Re: [Caml-list] Recovering masked methods">
<msg 
  url="2002/07/cdb48831ef99b8f2f30bb2c41cfffc21"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-16T10:03:53"
  subject="Re: [Caml-list] Recovering masked methods">
</msg>
<msg 
  url="2002/07/09f0c8681907e8992348940da99cad75"
  from="Johan Baltié &lt;johan.baltie@w...&gt;"
  author="Johan Baltié"
  date="2002-07-16T10:08:20"
  subject="Re: [Caml-list] Recovering masked methods">
</msg>
</msg>
<msg 
  url="2002/07/a4e7111559c35cc347dce02da761c6d4"
  from="Johan Baltié &lt;johan.baltie@w...&gt;"
  author="Johan Baltié"
  date="2002-07-16T09:59:43"
  subject="Re: [Caml-list] Recovering masked methods">
<msg 
  url="2002/07/d8d8048f18fde67a30d15fff45a35cd0"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-16T11:01:06"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
<msg 
  url="2002/11/016e4090efb8e82cad8d8d8247cc1f70"
  from="Eray Ozkural &lt;erayo@c...&gt;"
  author="Eray Ozkural"
  date="2002-11-12T19:47:58"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
</msg>
<msg 
  url="2002/07/b59eca1b7e5590da95546ae14fabfec6"
  from="Johan Baltié &lt;johan.baltie@w...&gt;"
  author="Johan Baltié"
  date="2002-07-16T11:32:44"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
<msg 
  url="2002/07/079c1f77e6e6ffdeb3b3e90ab408aff5"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-16T12:45:21"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
</msg>
</msg>
<msg 
  url="2002/07/3de0fe9da97cf529cecbfd91303a3bd0"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-07-16T12:26:56"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
<msg 
  url="2002/07/3010b130a14bbcce52ad13d282b7bc8e"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-16T12:47:43"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
<msg 
  url="2002/07/b81da613b70144f0000c305c48fda6a9"
  from="Daniel de Rauglaudre &lt;daniel.de_rauglaudre@i...&gt;"
  author="Daniel de Rauglaudre"
  date="2002-07-17T09:26:40"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
</msg>
</msg>
</msg>
<msg 
  url="2002/07/e7cc3630ab3efd751fb7ab23ee8cd246"
  from="John Prevost &lt;j.prevost@c...&gt;"
  author="John Prevost"
  date="2002-07-16T13:25:28"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
<msg 
  url="2002/07/64938492e1b530128ae42eb730af62b2"
  from="John Prevost &lt;j.prevost@c...&gt;"
  author="John Prevost"
  date="2002-07-16T13:28:39"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
</msg>
<msg 
  url="2002/07/22bfb44ade56966015ca1e7b98b02394"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-16T13:59:43"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
<msg 
  url="2002/07/4b34e2322a3787668e7cc44878eaae57"
  from="Johan Baltié &lt;johan.baltie@w...&gt;"
  author="Johan Baltié"
  date="2002-07-16T14:15:50"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
<msg 
  url="2002/07/429a6ddd7c1da1d3259de9ec4b1a2c13"
  from="Alessandro Baretta &lt;alex@b...&gt;"
  author="Alessandro Baretta"
  date="2002-07-16T14:22:35"
  subject="Re: [Caml-list] Recovering masked methods (with CamlP4?)">
</msg>
</msg>
</msg>
</msg>
</msg>
</msg>
<msg 
  url="2002/07/bdc2038f2220ce701049a9e8d6a5abc9"
  from="John Prevost &lt;j.prevost@c...&gt;"
  author="John Prevost"
  date="2002-07-16T10:38:38"
  subject="Re: [Caml-list] Recovering masked methods">
</msg>
</msg>
</msg>
</msg>
</thread>

<contents>
From: Alessandro Baretta &lt;alex@baretta.com&gt;

&gt; I have code similar to the following
&gt; 
&gt; class a =
&gt; object (self)
&gt;    method m = 1
&gt;    method n = "Hello!"
&gt; end
&gt; 
&gt; class b =
&gt; object (self)
&gt;    inherit a as super_a
&gt;    method m = 2
&gt; end
&gt; 
&gt; Now I would like to define a third class, inheriting from b. 
&gt;   I need this class to be able to access the definition of 
&gt; method m from class a, otherwise I would have to use "copy &amp; 
&gt; paste", which is contrary to my programmer's ethics.

You don't need to be too ethical about that.
What's so great about strong typing, is that it makes copy-paste work!

And you can always write

let a_m = 1
class a = ... method m = a_m ..

This way you can still share the code (but you need to pass private
methods by hand).

If you want to stay indide the object, you can also save the old
method to a private one:

class b = ... method private a_m = super_a#m ...

&gt; Ideally, I would like to write
&gt; 
&gt; class c =
&gt; object (self)
&gt;    inherit b as super_b
&gt; 
&gt;    method m =
&gt;      (* some_stuff *)
&gt;      super_b # super_a # m
&gt; end
&gt; 
&gt; Presently, this is not allowed. Is there any specific reason 
&gt; for this? Could such a feature be implemented in the future?

OK, you want something like C++'s qualified calls?
There's no project to do that. Methods do not exist independently of
their class.
Another approach would be to provide views, as described by Jerome
Vouillon. That is, an object could keep some extra sets of methods in
an abstract way. But there's not project to implement that either.

Yet, it's not even clear such an ancestor call would make sense in
general.
Could you give some more compelling example requiring such a feature?

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

