From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id C63D7BCAE for ; Tue, 28 Jun 2005 14:24:45 +0200 (CEST) Received: from mxintern.schlund.de (mxintern.kundenserver.de [212.227.126.201]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j5SCOj5x020490 for ; Tue, 28 Jun 2005 14:24:45 +0200 Received: from [172.17.36.11] (helo=schluck.use.schlund.de) by mxintern.kundenserver.de with esmtp (Exim 4.34) id 1DnF8e-0006iE-9b; Tue, 28 Jun 2005 14:24:28 +0200 From: Michael Wohlwend To: caml-list@yquem.inria.fr, Jacques Garrigue Subject: Re: [Caml-list] state pattern... Date: Tue, 28 Jun 2005 14:24:27 +0200 User-Agent: KMail/1.8 References: <200506262157.02201.micha-1@fantasymail.de> <200506280123.55251.micha-1@fantasymail.de> <20050628.095406.112629429.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20050628.095406.112629429.garrigue@math.nagoya-u.ac.jp> X-Face: S)[vu%Bha1d&ej9GfwAq~7C}A,y[B.uS}+D6'hb~xPwsxymw$fnCOaMe<=?utf-8?q?*bnUajSBR=5Fm=3FR=0A=09?=@V3;iX8[A}z`.%pEQ1r7iZhN8#ktTCBQ}&mkx>=RH&l|l6\]NZI@ MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200506281424.28051.micha-1@fantasymail.de> X-Virus-Scanned: Symantec AntiVirus Scan Engine X-Miltered: at concorde with ID 42C1418D.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 'self:01 'self:01 subtype:01 cheers:01 ...:98 ...:98 seems:03 pattern:03 context:04 context:04 problem:05 indeed:05 written:06 implementing:06 X-Spam-Checker-Version: SpamAssassin 3.0.2 (2004-11-16) on yquem.inria.fr X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.2 X-Spam-Level: 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