From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.3 required=5.0 tests=AWL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 217FCBBC1 for ; Mon, 10 Mar 2008 09:42:29 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnEAADaR1EfVpUAUmWdsb2JhbACQfgEBAQEBBgQGCQgWlns X-IronPort-AV: E=Sophos;i="4.25,473,1199660400"; d="scan'208";a="9207001" Received: from mail.gmx.net ([213.165.64.20]) by mail1-smtp-roc.national.inria.fr with SMTP; 10 Mar 2008 09:42:28 +0100 Received: (qmail invoked by alias); 10 Mar 2008 08:42:27 -0000 Received: from p57B1CD25.dip.t-dialin.net (EHLO pc21b.local) [87.177.205.37] by mail.gmx.net (mp054) with SMTP; 10 Mar 2008 09:42:27 +0100 X-Authenticated: #20477425 X-Provags-ID: V01U2FsdGVkX19AHJBBLnFAsF6yYHjsv4OCQDFE4v1lqh9I+j/8AJ 4mpc2Iotat8qSM From: Michael Wohlwend To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] oo type question Date: Mon, 10 Mar 2008 09:38:17 +0100 User-Agent: KMail/1.9.7 References: <200803061352.38360.micha-1@fantasymail.de> <200803061645.30224.micha-1@fantasymail.de> <20080310.172043.180101905.garrigue@math.nagoya-u.ac.jp> In-Reply-To: <20080310.172043.180101905.garrigue@math.nagoya-u.ac.jp> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200803100938.17756.micha-1@fantasymail.de> X-Y-GMX-Trusted: 0 X-Spam: no; 0.00; someclass:01 ocaml:01 casts:01 10.:98 caml-list:01 interfaces:01 declaring:02 declaration:02 objects:02 objects:02 garrigue:03 jacques:03 programming:03 types:05 variable:06 Am Montag, 10. M=E4rz 2008 09:20:43 schrieb Jacques Garrigue: ok, thanks for the explanations, > From: Michael Wohlwend > > A small remark yet: in interfaces (and class types) it is ok to write > class c : object > method add : #someClass -> ... > end > Here it is automatically assumed that the type variable is bound at > the method level. ah o.k, nice to know. I'll try that. (I thought declaring something to be of type #class is similar to=20 the "implenents" declaration in java, where you can pass objects without a= =20 cast to methods accepting arguments of that interface, which I find=20 nice :-) ) I like the oncept of ocaml to make no implizit casts; only when using objec= ts=20 I think casting to an upper class (!) should be done automatically since it= 's=20 one of the basic "features" of oo programming.=20 Michael