caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alessandro Baretta <alex@baretta.com>
To: John Prevost <j.prevost@cs.cmu.edu>, Ocaml <caml-list@inria.fr>
Subject: Re: [Caml-list] Recovering masked methods (with CamlP4?)
Date: Tue, 16 Jul 2002 16:06:45 +0200	[thread overview]
Message-ID: <3D342875.2000704@baretta.com> (raw)
In-Reply-To: <86u1mzu7c7.fsf@laurelin.dementia.org>



John Prevost wrote:

> You've simply got the wrong ordering in your inheritance.  There's
> absolutely no need for more functionality to support accessing "older"
> methods in this case.  (I'd argue there's no need in any case.)  And
> again, even if method m had to be different in var_b, it would be
> better to use an inherited class which has the features common to b
> and var_b.  In this case, that class is identical to b.
> 
> John.


Not a bad idea, actually. From a conceptual standpoint it 
works. It did not occur to me go about coding that way 
because my classes come in "related packages", and given 
this conceptual grouping, it would sort of look funny to 
implement what you suggested.
...
Now that you make me think of it, all I need is an 
intermediate class in my hierarchy, factoring all the the 
common functionality with the exception of two methods: 
let's say m and n. I'll then have a package inherit from the 
common ancestor and redefine m, while the other package 
redefines n. This intermediate layer will remove the need to 
call a method in a farther ancestor.

Thank you for the suggestion.

Alex

-------------------
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:[~2002-07-16 13:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-15 23:13 [Caml-list] Recovering masked methods Alessandro Baretta
2002-07-16  1:15 ` Jacques Garrigue
2002-07-16  9:28   ` Alessandro Baretta
2002-07-16  9:48     ` Laurent Vibert
2002-07-16 10:08       ` Johan Baltié
2002-07-16 10:10       ` Alessandro Baretta
2002-07-16  9:59     ` Johan Baltié
2002-07-16 11:08       ` [Caml-list] Recovering masked methods (with CamlP4?) Alessandro Baretta
2002-07-16 11:32         ` Johan Baltié
2002-07-16 12:52           ` Alessandro Baretta
2002-07-16 12:26         ` Daniel de Rauglaudre
2002-07-16 12:54           ` Alessandro Baretta
2002-07-17  9:26             ` Daniel de Rauglaudre
2002-07-16 13:32         ` John Prevost
2002-07-16 13:35           ` John Prevost
2002-07-16 14:06           ` Alessandro Baretta [this message]
2002-07-16 14:15             ` Johan Baltié
2002-07-16 14:29               ` Alessandro Baretta
2002-11-11  9:20         ` Eray Ozkural
2002-07-16 10:45     ` [Caml-list] Recovering masked methods John Prevost

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=3D342875.2000704@baretta.com \
    --to=alex@baretta.com \
    --cc=caml-list@inria.fr \
    --cc=j.prevost@cs.cmu.edu \
    /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).