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.0 required=5.0 tests=none 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 218A6BC69 for ; Thu, 18 Oct 2007 09:37:46 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ao8CAPqpFkeCulhph2dsb2JhbACBWox0AgEICimBJw X-IronPort-AV: E=Sophos;i="4.21,293,1188770400"; d="scan'208";a="3145391" Received: from fiton.bononia.it ([130.186.88.105]) by mail1-smtp-roc.national.inria.fr with ESMTP; 18 Oct 2007 09:37:45 +0200 Received: from aquarium.takhisis.invalid (fiton.bononia.it [130.186.88.105]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "Stefano Zacchiroli", Issuer "sockmel.bononia.it" (verified OK)) by fiton.bononia.it (Postfix) with ESMTP id 92A00148BB for ; Thu, 18 Oct 2007 09:37:29 +0200 (CEST) Received: by aquarium.takhisis.invalid (Postfix, from userid 1000) id 704F01241E5; Thu, 18 Oct 2007 09:37:42 +0200 (CEST) Date: Thu, 18 Oct 2007 09:37:42 +0200 From: Stefano Zacchiroli To: caml-list@yquem.inria.fr Subject: Re: [Caml-list] Smells like duck-typing Message-ID: <20071018073742.GB523@takhisis.invalid> References: <932096.75090.qm@web54602.mail.re2.yahoo.com> <110865.97148.qm@web54605.mail.re2.yahoo.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <110865.97148.qm@web54605.mail.re2.yahoo.com> User-Agent: Mutt/1.5.16 (2007-06-11) X-Spam: no; 0.00; zacchiroli:01 zack:01 0100,:01 cheers:01 zacchiroli:01 zack:01 unibo:01 wrote:01 caml-list:01 functions:01 inherit:01 int:01 reuse:01 define:02 string:02 On Wed, Oct 17, 2007 at 09:24:05PM +0100, Dario Teixeira wrote: > ideas. For the time being, I am going for the no-inheritance object solution: Uhm sorry, why aren't you going for the object *with* inheritance solution? The one you're proposing here is more lightweight than the initial one due to the lack of option types, not due to the lack of inheritance. Can't you just go for: class blurb (id, title, intro) = object method id: int = id method title: string = title method intro: string = intro end class full (id, title, intro, body) = object inherit blurb (id, title, intro) method body: string = body end that way you would also gain code reuse and can maybe define printing functions on top of each other. Cheers. -- Stefano Zacchiroli -*- PhD in Computer Science ............... now what? zack@{cs.unibo.it,debian.org,bononia.it} -%- http://www.bononia.it/zack/ (15:56:48) Zack: e la demo dema ? /\ All one has to do is hit the (15:57:15) Bac: no, la demo scema \/ right keys at the right time