From: Michael Wohlwend <micha-1@fantasymail.de>
To: caml-list@yquem.inria.fr,
Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Subject: Re: [Caml-list] state pattern...
Date: Tue, 28 Jun 2005 14:24:27 +0200 [thread overview]
Message-ID: <200506281424.28051.micha-1@fantasymail.de> (raw)
In-Reply-To: <20050628.095406.112629429.garrigue@math.nagoya-u.ac.jp>
thanks for your reply, it's increasing my understanding of the object system,
although there are some (or more... :-) open points:
In:
class ['state] context s =
object (this:'self)
...
end
what are the reasons to give 'this' a type, and isn't 'self a type-variable? I
thought it ('this') has the type of the class (= _context) ? I don't
understand why and when it is needed to give the object a type.
The same with:
class state1 = object (this : _ #state) ... end
I thought class state1 is a subtype (or implementing the class-type) #state,
since the methods are the same. Why does it help to give the obejct a type?
thanks for your help, I would really like to understand the object system
better. The state machine is surely better written using records and
function; but this (supposed to be) little task is/was helping me indeed
learning more of the class system. (And I hate it, not being able to solve a
problem, which seems to be an easy one :-)
cheers
Michael
next prev parent reply other threads:[~2005-06-28 12:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-26 19:57 Michael Wohlwend
2005-06-26 22:13 ` [Caml-list] " james woodyatt
2005-06-26 22:45 ` Michael Wohlwend
2005-06-27 23:23 ` Michael Wohlwend
2005-06-28 0:54 ` Jacques Garrigue
2005-06-28 12:24 ` Michael Wohlwend [this message]
2005-06-28 13:20 ` 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=200506281424.28051.micha-1@fantasymail.de \
--to=micha-1@fantasymail.de \
--cc=caml-list@yquem.inria.fr \
--cc=garrigue@math.nagoya-u.ac.jp \
/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