From: "#!Fì£é__1³~~ 0=2°" <file13@Qlippoth.zzn.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] OO Interface
Date: Thu, 17 Jan 2002 16:31:56 -0600 [thread overview]
Message-ID: <AFE412B9EBC9E534983D16230479F6D3@file13.Qlippoth.zzn.com> (raw)
the easiest way to do it is to simply assign
initial values to x and y:
# class p (x:int) (y:int) =
object(self)
val x = 0
val y = 0
method pos = (x,y)
end;;
class p : int -> int -> object method pos : int
* int val x : int val y : int end
# let x = new p 5 7;;
val x : p = <obj>
# x#pos;;
- : int * int = 0, 0
hope this helps....
file13
http://www.qlippoth.com/
---- Begin Original Message ----
From: "Warp" <warplayer@free.fr>
Sent: Thu, 17 Jan 2002 21:34:14 +0100
To: "OCaml" <caml-list@inria.fr>
Subject: [Caml-list] OO Interface
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.
I don't want to, but perhaps I have to use a
Module ?
Thanks
Warp
-------------------
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
---- End Original Message ----
No 'Truth' until Silence!! The 777 Devils mail http://qlippoth.zzn.com
____________________________________________________________
Get your own FREE Web and POP E-mail Service in 14 languages at http://www.zzn.com.
-------------------
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
next reply other threads:[~2002-01-17 22:33 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-01-17 22:31 #!Fì£é__1³~~ 0=2° [this message]
-- strict thread matches above, loose matches on Subject: below --
2002-01-17 20:34 Warp
2002-01-18 6:49 ` Jacques Garrigue
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=AFE412B9EBC9E534983D16230479F6D3@file13.Qlippoth.zzn.com \
--to=file13@qlippoth.zzn.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