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=1.3 required=5.0 tests=SPF_FAIL autolearn=disabled version=3.1.3 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 9C158BC6F for ; Thu, 3 May 2007 01:05:01 +0200 (CEST) Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by concorde.inria.fr (8.13.6/8.13.6) with SMTP id l42N51or017045 for ; Thu, 3 May 2007 01:05:01 +0200 Received: (qmail invoked by alias); 02 May 2007 23:04:58 -0000 Received: from Xdc40.x.pppool.de (EHLO hmmm.de) [89.59.220.64] by mail.gmx.net (mp039) with SMTP; 03 May 2007 01:04:58 +0200 X-Authenticated: #20477425 X-Provags-ID: V01U2FsdGVkX1+DVRMBQf+DfTbqBaFV2OSCNpqWSdFcNMzzZYrdAe 8njAfkIHnfnbOy Date: Thu, 3 May 2007 01:04:58 +0200 From: micha To: caml-list@inria.fr Subject: objects as method arguments Message-ID: <20070503010458.778128e2@hmmm.de> X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.20; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-Miltered: at concorde with ID 4639191D.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; cheers:01 inherit:01 inherit:01 objects:02 arg:03 arg:03 unit:03 ugly:03 arguments:07 michael:07 rather:08 looks:08 everytime:08 fun:08 object:09 I want to have the following: class c = object inherit base method m (arg : #base) = arg#do_something end;; this gives an error. Is the only way to get this working to write it that way? class c = object inherit base method m: 'a. (#base as 'a) -> unit = fun arg -> arg#do_something end;; If I have more of such methods, that looks rather ugly. Also I don't want to cast the argument-object to the baseclass type everytime... do I overlook something? cheers Michael