From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: briand@aracnet.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] method name collision ?
Date: Sun, 26 Dec 2004 07:57:48 +0900 (JST) [thread overview]
Message-ID: <20041226.075748.126851009.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <16845.50460.152550.387582@soggy.deldotd.com>
From: briand@aracnet.com
> I'm getting the following error
>
> The method point has type 'a -> 'b but is expected to have type
> x:int -> y:int -> unit
>
> for this code :
>
> method point p0 =
> etc..
>
> The error makes sense, as in, I know that it is colliding with a
> method defined in the drawable class.
>
> However I am inheriting the class using :
>
> inherit GDraw.drawable ?colormap w as drawable
>
> It seems to me that the method I am defining, self#point, and the
> method in drawable, i.e. drawable#point, are distinct and therefore
> I should not be seeing this error message ?
The "as drawable" doesn't mean that the methods are distinct: you can
still call all inherited methods from the outside, and even through
self.
This only allows you to access the old definition of a method, if you
want to extend it incrementally.
method point ~x ~y =
... drawable#point ~x ~y ...
Jacques Garrigue
next prev parent reply other threads:[~2004-12-25 22:58 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-25 19:53 briand
2004-12-25 22:57 ` Jacques Garrigue [this message]
2004-12-26 18:20 ` [Caml-list] " 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=20041226.075748.126851009.garrigue@math.nagoya-u.ac.jp \
--to=garrigue@math.nagoya-u.ac.jp \
--cc=briand@aracnet.com \
--cc=caml-list@inria.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