Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "François Pottier" <francois.pottier@inria.fr>
To: Nathan Moreau <nathanjmoreau@gmail.com>
Cc: caml users <caml-list@inria.fr>
Subject: Re: [Caml-list] How to indicate that I am overriding an inherited virtual method?
Date: Fri, 13 Jan 2017 12:04:23 +0100	[thread overview]
Message-ID: <b7f9e31b-2f16-dd2a-56b7-8e3d5a271930@inria.fr> (raw)
In-Reply-To: <CADDcBWXDbGyntNnv22Z4hv5K98OXu21mxS2d8Ju7k8ygqAmaQQ@mail.gmail.com>

On 13/01/2017 10:20, Nathan Moreau wrote:
> You can ensure you are overriding, using
>
>   class virtual base = object
>     method virtual foo: string
>   end
>
>   class child = object
>     inherit base as b
>     method foo = if false then b # foo else "ha!"
>       (* OK *)
>   end

Interesting trick (albeit somewhat ugly), thanks!

-- 
François Pottier
francois.pottier@inria.fr
http://gallium.inria.fr/~fpottier/

      parent reply	other threads:[~2017-01-13 11:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-13  9:09 François Pottier
     [not found] ` <CADDcBWXDbGyntNnv22Z4hv5K98OXu21mxS2d8Ju7k8ygqAmaQQ@mail.gmail.com>
2017-01-13 11:04   ` François Pottier [this message]

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=b7f9e31b-2f16-dd2a-56b7-8e3d5a271930@inria.fr \
    --to=francois.pottier@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=nathanjmoreau@gmail.com \
    /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