caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp>
To: warplayer@free.fr
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] OO Interface
Date: Thu, 17 Jan 2002 22:49:37 -0800	[thread overview]
Message-ID: <20020117224937B.garrigue@kurims.kyoto-u.ac.jp> (raw)
In-Reply-To: <02fd01c19f96$548297c0$ac00a8c0@warp>

From: "Warp" <warplayer@free.fr>

> If I got a parametrized class like :
> 
> class p (x:int) (y:int) =
> object(self)
>     val x = x
>     val y = y
>     method pos = (x,y)
> rnd
> 
> How do I write the correct interface for this class ? I can't figure out how
> to specify the parameters type.

Here is the interface, as the typechecker tells you,
class p :
  int -> int -> object method pos : int * int val x : int val y : int end

You can directly write it in the .mli.

Or did you mean class type?
Actually, this automatically defines the following class type,
class type p =
  object method pos : int * int val x : int val y : int end

Hope this helps,

Jacques Garrigue
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2002-01-18  7:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-17 20:34 Warp
2002-01-18  6:49 ` Jacques Garrigue [this message]
2002-01-17 22:31 #!Fì£é__1³~~ 0=2°

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=20020117224937B.garrigue@kurims.kyoto-u.ac.jp \
    --to=garrigue@kurims.kyoto-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=warplayer@free.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).