caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Guillaume Yziquel <guillaume.yziquel@citycable.ch>
To: caml-list@inria.fr
Subject: polymorphic method.
Date: Thu, 10 Sep 2009 14:30:39 +0200	[thread overview]
Message-ID: <4AA8F16F.1040009@citycable.ch> (raw)
In-Reply-To: <4AA191F3.5000004@yziquel.homelinux.org>

Hello.

When developing with objects in OCaml, I'm quite often faced with 
polymorphic methods.

Such as:

class myobject = object
   method id x = x
end

Sometimes you have many methods that you're tinkling with, and the 
compiler keeps saying to you that 'a is inbound in this class declaration.

I'm therefore wondering if it would be a good idea to have a keyword 
'polymorphic', and one would write

class myobject = object
   polymorphic method id x = x
end

The polymorphic keyword would be a hint that the method is polymorphic 
and that there is no need to look at the class' type parameters.

-- 
      Guillaume Yziquel
http://yziquel.homelinux.org/


  parent reply	other threads:[~2009-09-10 12:35 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <4AA191F3.5000004@yziquel.homelinux.org>
2009-09-10 12:30 ` Guillaume Yziquel
2009-09-10 12:30 ` Guillaume Yziquel [this message]
2009-09-10 12:48   ` [Caml-list] " Jacques Garrigue
2009-09-10 13:05     ` Guillaume Yziquel
2009-09-10 14:21       ` Jacques Garrigue
2009-09-10 19:14         ` Guillaume Yziquel
2009-09-11  7:14           ` blue storm
2009-09-11  8:20             ` Guillaume Yziquel
2009-09-11  8:18           ` Jacques Garrigue
2009-09-11  9:40             ` Guillaume Yziquel

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=4AA8F16F.1040009@citycable.ch \
    --to=guillaume.yziquel@citycable.ch \
    --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;
as well as URLs for NNTP newsgroup(s).